Margin on NG Gallery slidesow
The NG Gallery is one of my favorite WordPress plugins
However, I’ve run into a formatting issue when I need my slideshow to be flush against an element of one of my designs. See the EnergyLogicAcademy.com website for an example.
The plugins CSS contains an extra 10px margin that must be removed to fix this. When the Slideshow gallery plugin is activated, it requires a css adjsutment to the nggallery.css file to close the gap at the top of the slideshow.
Go to
/* ———– Gallery style ————-*/
.ngg-galleryoverview {
overflow: hidden;
margin-top: 10px;
width: 100%;
clear:both;
display:block !important;
}
Change margin-top to 0
Don’t forget your ul tags around widgets!
Did you know that WordPress widgets are always, always, list items?
Widgets in WordPress are wrapped in list-item tags in the file includes/widgets.php – around line 550:
$defaults = array(
'name' => sprintf(__('Sidebar %d'), $i ),
'id' => "sidebar-$i",
'description' => '',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => "</li>\n",
'before_title' => '<h2 class="widgettitle">',
'after_title' => "</h2>\n",
);
However, you’ll notice that the code does not include the <ul> </ul> tags.
In your theme template, when including widgets, you might use something like this:
<div id=”sidebar”><?php /*
Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘widget area name’) ) : ?>
<?php endif; ?></div><!–close sidebar–>
When implementing a text widget, the resulting code will end up looking something like this – note the missing UL tags:
<div id=”sidebar”><li id=”text-3″ class=”widget widget_text”> <h2 class=”widgettitle”>
test
< /h2> <div class=”textwidget”>
test
</div> </li> </div> <!–close sidebar–>
This may not seem like such a big deal, but the missing <ul> tags can cause havoc in formatting your sidebars in css, and will also return the following W3C validation errors in your site:
document type does not allow element “li” here; missing one of “ul”, “ol”, “menu”, “dir” start-tag
To avoid these issues, simply enclose the widget code in a <ul>:
<div id=”sidebar”><ul><?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘widget area name’) ) : ?>
<?php endif; ?></ul></div><!–close sidebar–>
And use the following style if you don’t want your sidebars to look like bullet lists:
#sidebar ul
{
margin: 0;
padding: 0;
list-style:none;}
Style for removing widget bullet
All widgets are automatically surrounded by a
<li>tag in the code.
For example – a Recent Posts widget appears like this in the source code:
<!–recent posts–>
<li>
<h2>Recent Posts</h2>
<ul>
<li><a title=”Keeping the tab “on”” href=”http://websitesbyjen.com/wordpress/?p=139″>Keeping the tab “on”</a></li>
</ul>
</li>
And would typically display like this:
- Keeping the tab “on”
If you don’t want to have a bullet in front of your widget title (it doesn’t work well with many template styles), add the following to your CSS:
li.widget
{list-style:none;}
So simple, a caveman could do it.
Keeping the tab “on”
This is the syntax for styling a background tab in WordPress dropdown menus. This will keep the top tab “on” for all sub-pages.
.menu ul li a.current_parent
{
color: #2e4a81;
background-color: #2e4a81;
background-image:url(./images/tabbg.jpg);
background-position: top right;
background-repeat: no-repeat;
}
The Cub Scout Promise
My son, Tyler, is a new cub scout and I just attended my first-ever cub scout meeting with him. He’s been to a few meetings with his Dad, but I’ve tried to stay out of all that “boy stuff”. Last night my husband had to attend an extremely important meeting (fishing club), so I had to pitch in and be the parent-partner at his Cub Scout meeting. This was an important one because the boys got to practice driving a rickety wooden cart down a steep hill.
Having your mom at a cub scout meeting is definitely a liablility from my son’s perspective. I kept doing embarrasing things like making him wear a coat, adjusting his helmet, cheering too loudly when he used the brake to slow down, and hugging him when I realized he survived the 50 yard plummet. It was also bad from my perspective because every vessel of mom-blood in my veins was screaming “noooooooo!” when the scout leader shoved the go-cart carrying my precious child down the hill and let go.
Thankfully the cub scouts all survived with their limbs intact, and we went inside for cookies & business. Before the close of the meeting, the Scout Leader tested each of the bouncing, wriggling, cookie & juice-filled boys on the Cub Scout Promise, which they are supposed commit to memory and recite on command. I’m sure I’ve heard the promise before, maybe 35 years ago when my brother was a cub scout, but I’ve never heard my son or husband mention it, and they certainly haven’t been practicing. With prompting, Ty could start out with “I, Tyler”…” an it would fade to an untelligible mumble from there.
Aha – something I could help with that doesn’t involve door-to-door sales or potential broken bones! We practiced the promise in the car all the way home. It goes like this:
“I, Tyler, promise to do my best
to do my duty
to God and my Country
to help other people
and obey the law of the pack.”
Maybe Mom’s should have their own promise. Something like:
“I, Tyler’s Mom Jen, promise to do my best
to let my son be brave and daring,
to help without embarassing him,
and to not eat all the cookies of the pack.”
