Subscribe to the RSS Feed
FreeWordpressThemes.us
Free WordPress Tutorials and Themes.

Add a Widgetized Footer to Your WordPress Theme

May 12th, 2009 by admin

The inspiration for this tutorial comes from a tweet I received with feedback for the soon-to-be-released RS12 theme.

zakmorris twitter response

Although the widgetized footer did not ultimately make it in the release of the RS12 theme, I decided to write this tutorial to show people how exactly to add a widgetized footer in your theme. In this guide, you’ll learn:

  • The HTML and CSS code needed to produce the widgetized footer
  • How to add commonly used WordPress template tags as placeholders
  • How to widgetize the footer and place widgets inside it

There’s going to be a lot of code in this post, so if you’re up for it, read on…

I’ll be using the Green Rays WordPress theme as my example in this tutorial. At the moment, the footer just has a standard “copyright” message and credits.

The HTML

The first step is to add the HTML markup. Let’s say we’re going to have three different sections in the widgetized footer with lists of Most Recent Posts, Monthly Archives, and Daily Archives. We’ll place this HTML code above the current “copyright” line.

<div class="footer-item">
<h3>Recent Posts</h3>
<ul>
<li><a href='#' title='Featured post'>Featured post</a></li>
<li><a href='#' title='Blockquotes'>Blockquotes</a></li>
<li><a href='#' title='How the ‘more’ tag works'>How the ‘more’ tag works</a></li>
<li><a href='#' title='Order or Unorder'>Order or Unorder</a></li>
</ul>
</div>
<div class="footer-item">
<h3>Monthy Archives</h3>
<ul>
<li><a href='#' title='March 2008'>March 2008</a></li>
<li><a href='#' title='February 2008'>February 2008</a></li>
<li><a href='#' title='January 2008'>January 2008</a></li>
<li><a href='#' title='December 2007'>December 2007</a></li>
</ul>
</div>
<div class="footer-item">
<h3>Daily Archives</h3>
<ul>
<li><a href='#' title='March 7, 2008'>March 7, 2008</a></li>
<li><a href='#' title='February 9, 2008'>February 9, 2008</a></li>
<li><a href='#' title='January 4, 2008'>January 4, 2008</a></li>
<li><a href='#' title='December 22, 2007'>December 22, 2007</a></li>
</ul>
</div>
<div class="clear"></div>

Basically this code puts each “widget” in a div. Inside each widget is a heading and an unordered list with links. Yes, I know the links don’t go anywhere. We’ll later replace this with WordPress template tags. Here’s what we have so far:

Green Rays Footer 1

The CSS

As you can see, this isn’t looking so good without any CSS styling. Add the following code to your stylesheet.

.footer-item {
float: left;
width: 33%;
padding-bottom: 10px;
}
.footer-item ul {
padding-left: 15px;
}

What this code does is float each footer item to the left, which basically means they can be side by side. The width is set to 33%, which gives enough room for three footer items in a single row. There is also a little bit of padding added below each footer item. The second piece is just padding the lists 15 pixels to the left.

Now you can see the HTML and CSS are starting to come together. Here’s what you should have so far:

Green Rays Footer 2

WordPress Code

At the moment, we have a bunch of empty HTML links, with no actual WordPress code. Let’s replace the lists under Recent Posts, Monthly Archives, and Daily Archives with the WordPress template tag equivalents. Replace what you currently have with the following:

<div class="footer-item">
<h3>Recent Posts</h3>
<ul>
<?php wp_get_archives('type=postbypost&limit=4'); ?>
</ul>
</div>
<div class="footer-item">
<h3>Monthy Archives</h3>
<ul>
<?php wp_get_archives('limit=4'); ?>
</ul>
</div>
<div class="footer-item">
<h3>Daily Archives</h3>
<ul>
<?php wp_get_archives('type=daily&limit=4'); ?>
</ul>
</div>

The parameters should be pretty self-explanatory, but if you’re not sure about any of them, try looking up wp_get_archives in the WordPress Template Tag Lookup Tool. Remember, I’m just using the wp_get_archives() template tags as a placeholder. We’ll be switching these out with other WordPress widgets later, after we widgetize the footer.

Widgetize It

For this section of the tutorial, I’ll be borrowing parts from my previous widgetizing themes tutorial.

The first step is to register the “sidebars.” To do this, simply replace the current contents of the functions.php file with the following:

<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '<div class="sidebaritem">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Footer',
'before_widget' => '<div class="footer-item">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
?>

Now we’ll go into sidebar.php and replace the current dynamic sidebar conditional tag with this:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

With this:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar") ) : ?>

Now we’ll go into our footer.php file and wrap the footer items in it’s own respective sidebar conditional tag. Right before the first “sidebar-item” div, add the following.

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Footer") ) : ?>

Right after the final closing “footer-item” div (and above the “clear” div which we added earlier) we’ll add the following:

<?php endif; ?>

Okay, now our sidebar and footer should be widgetized. Let’s test it out by adding a few widgets in the footer. I’ll add a Blogroll widget, Recent Comments widget, and a text widget. Here’s what it should look like:

Green Rays Footer 3

Conclusion

Well, that’s the basics of adding a widgetized footer to your theme. You may want to add separate styling rules for other types of widgets such as the calendar or search box. This probably won’t work with every theme, such as the RS12 theme for example, as it had a non-expandable footer.

If anyone wants the updated Green Rays theme by any chance, you can download it here. This way you can see where exactly I added the code. You can compare it with the original theme as well.

Hope you liked the tutorial. Will you be adding a widgetized footer to your theme? Is there anything in the code I used above you would do differently? Questions, comments, suggestions, and criticisms are all welcome, so feel free to sound off in the comments.

Written by - Visit Website

Posted in Theme Labs | No Comments »

RS13 – Free WordPress Theme

May 12th, 2009 by admin

Today we have another great looking blog theme, designed by Rambling Soul. The original template had a cool LavaLamp effect on the menu, which was then in turn included in the WordPress theme version. You can check it out for yourself on the demo by rolling over the top navigation menu items.

Anyway, this theme, like all themes released after this post, is coded for WordPress 2.7+ only. It has threaded comments, comment pagination, as well as all the other usual features like a widgetized sidebar, Gravatar support, and WordPress tag support.

RS13 screenshot
Live Demo | Download

Written by - Visit Website

Posted in Theme Labs | No Comments »

WordPress Theme Tweaker Plugin Review

May 12th, 2009 by admin

I recently came across a pretty cool plugin called Theme Tweaker, which basically lets you alter the colors of your theme without touching your CSS code. I thought I would go over this plugin in a review post. In this review, you’ll learn:

  • How to install the plugin in WordPress 2.7+
  • How to identify and change various colors to your liking
  • How to update your stylesheet with changes
  • How to generate a custom child theme on the fly

And now, onto the review…

How To Install Theme Tweaker

Luckily, this plugin is available in the official WordPress plugin directory. Therefore, it is readily available to be installed automatically through your WP admin panel.

Theme Tweaker Install

Just search “theme tweaker” and go through the install process. It should be pretty straightforward.

Theme Tweaker Activate

Go ahead and activate the plugin. Now that the plugin is successfully installed, let’s take it for a spin.

Changing Theme Colors

Now it’s time to put this plugin into action. I’ll be using the Lightweight theme for example purposes. This theme is completely imageless, and all colors are handled through CSS, so it will work well with this demonstration.

To change the colors, go to Appearance -> Theme Tweaker. On this page, you’ll be able to change individual colors using a HEX code or color picker. You can also change all the colors at once using a predefined color preset with the buttons on the right.

Theme Tweaker Colors

With the predefined color presets, you can do the following with the click of a button:

  • Invert colors
  • Black and white
  • B&W negative (inversion of above)
  • Sepia effect
  • Random colors

My favorite of these would probably have to be the random colors preset, since you can completely change the look of your blog theme with the click of a button. Okay, that’s the last time I say “click of a button.”

Lightweight Random Colors

The above is the result of the random colors preset. That’s pretty ugly, I know…but with enough random color clicks, something semi-good looking would probably come out of it.

Saving Your Changes

After you’ve picked your desired colors, you have a few options after this for saving your changes. By default, the color changes are only visible to you: the administrator. If you want to display them to all your viewers, you can simply select the “Activate the new color scheme” checkbox.

Theme Tweaker Options

For a more permanent solution, you can either generate a replacement stylesheet or a child theme. Picking either of these options will prompt you to download a style.css file. The result of the “Tweaked Stylesheet” could replace the current stylesheet of your theme, however I’d recommend the child theme generator.

With the style.css file created from the child theme generator, all you need to do is create a new directory on your /wp-content/themes/ folder, upload the stylesheet there, and then activate the new child theme in your admin panel.

Conclusion

All in all, I think this is a great plugin, especially useful to people who aren’t comfortable with manually editing CSS code themselves. The color picker and color presets make it really easy to change the colors of your blog. Although I used it to completely change the entire look, it could also be used for changing minor details, like link colors, etc. The child theme generator feature is also pretty cool.

Anyway, hope you liked the review. If you wanted to change the colors of your blog, would you consider using a plugin like this, or would you rather just edit the stylesheet (or make a child theme) manually? Let me know what you think in the comments.

Oh yeah, and if anyone wants the ugly Lightweight child theme (pictured above) by any chance, download it here.

Written by - Visit Website

Posted in Theme Labs | No Comments »

WordPress Theme Checklist By WP Toy

May 12th, 2009 by admin

Just heard about this pretty cool release by Stefan Vervoort of WP Toy. The WordPress Theme Development Checklist is a free-to-download PDF file that goes over several elements of a WordPress theme you should probably take a look at before going live with a new theme.

WordPress Theme Development Checklist

It’s broken up into eight parts, which will be gone over below:

  • General: Has the basics of WordPress theme creation, including information in the comments of the theme stylesheet, widget-readiness, backwards compatibilty, and screenshot.
  • Stylesheets: Every WordPress theme needs a stylesheet called style.css, but also goes over a few common types of optional stylesheets such as a reset.
  • Browser Compatibility: Gotta make sure your themes don’t screw up in Internet Explorer.
  • Pages: Goes over the theme files used in the Template Hierarchy including the main index, single posts, and archives.
  • Styles: Makes sure the most common elements are styled, such as headings, tables, and lists.
  • Standard CSS Classes: Goes over a number of CSS classes used by WordPress such as the various image classes.
  • Validate: A reminder of the different pages you should check to see if they are validated, both CSS and HTML.
  • WordPress Code: Goes over some of the commonly used WordPress code, such as The Loop.
  • Blog Elements: Goes over a number of elements your theme probably should have in place. Things like the title, navigation, and a copyright message.

I realize some people might have no clue what some of the things mean on the checklist (despite my best efforts to explain them), however keep in mind, I think this was intended for theme developers who are likely already familiar with things like the WordPress CSS classes.

To the WP theme developers out there: is there anything you can think to add to this checklist? Would you consider, or do you already use something like this to aide in your theme development? I’m not sure I’d frame this and hang it up on my wall, but I’d definitely print it out and keep it for future reference.

Written by - Visit Website

Posted in Theme Labs | No Comments »

FreshPick – Free WordPress Theme

May 11th, 2009 by admin

Today we have a very cool free WordPress theme which I ported from a template by one of my favorite free template designers, Erwin of Styleshout. Like the last few previous themes, it is coded for WordPress 2.7+ only, and it won’t work on previous versions. It has a number of cool features, including a featured post box, custom archive and search templates, an options page, and four widgetized areas (including a widgetized footer). These features will be gone over below.

FreshPick screenshot
Live Demo | Download

And now onto the features in more detail…

Featured Post

As you can see on the demo, this theme has a featured post box, along with room for a featured image. The box will display the latest post, unless there is a sticky post defined, in which case it will display the latest sticky post. A featured image will be displayed on the left, with an excerpt displayed on the right.

To get the featured image working, simply upload a 280×250 image, and paste the full path to the URL in the custom write panel. Thanks to this tutorial for the code.

FreshPick Featured Image URL

If no image is defined, the below default image will be used instead:

FreshPick Default Featured Image

This default image can be overridden by replacing the freshpick/images/img-featured.jpg file, which should be 280×250 pixels as well.

Single Post Image

On the same post settings menu, you can also set a wide post image that will span across the top of your post content. The image should be about 510 pixels wide. Although the height can vary, it probably shouldn’t be any higher than about 250 pixels.

FreshPick Post Settings

Again, make sure you input the full path to the image in this box.

Archive / Search Templates

The archives template is something that was present in the original design that I thought would be cool to implement into the WordPress theme, and was actually pretty simple thanks to the template hierarchy. All archive pages, including categories, monthly/weekly/daily archives, and tags will have the following template. This also applies to search results.

FreshPick Archive Template

Flickr Photostream

This is something I’ve implemented in a few of the other ported themes here, including Miniml and Transmission. It is displayed by default in the left footer. Here’s how to set it up:

  • In WordPress 2.7, go to the Plugins -> Add New. Type “flickrRSS” into the search box.
  • Select “flickrRSS” from the results (should be first). Install and activate it. It will say it hasn’t been tested with your version of WordPress yet, but I’m using it now with WordPress 2.7.1 and it works fine.
  • Once activated, go to Settings -> FlickrRSS, and select to display 4 user photos. This is how it’s set up on the demo, although you can play around with these settings if you find something you like.
  • Obviously, you’ll also need to input a Flickr user ID, which can be obtained by clicking the “Find your id” link on the FlickrRSS page in your admin panel.

As a visual reference, here’s a screenshot of how mine is set up at the moment.

FreshPick FlickrRSS Settings

And remember, it’s okay if your settings vary slightly, specifically the User ID – but also the display settings as well. The FlickrRSS can also be used as a widget (more info on widgets below).

About Text

Similar to Mountain Leaves and Underwater, the FreshPick theme has a theme options page to control the “about text” and image, which is displayed on the right footer by default.

FreshPick Theme Options

This should be pretty self explanatory, although here’s some more detailed descriptions of the three different options.

  • Title: You could change this to something like “About Us” or “About This Blog,” whatever you think would be appropriate. The default is set to: “About”
  • Image URL: If you have a small avatar-like image (around 40×40), simply put the full path to that image in this box. If you don’t have one, no problem. A mystery man will be displayed if that is the case.
  • Message: You can write a little about yourself and/or your blog in this box. Just a few sentences would be enough.

Widgetized Areas

As mentioned above, there are four widgetized areas:

  • Sidebar
  • Left Footer
  • Middle Footer
  • Right Footer

The following diagram will illustrate where exactly these widgetized areas are. Click to enlarge.

FreshPick Widgets

Conclusion

Remember, since this is a WordPress 2.7 theme, there are features like comment threading and pagination, as well as Gravatar support.

That should be everything. I’d love to hear your thoughts on the theme, and thanks again to Styleshout for the template. Remember, any support-related inquiries should be posted in the forums.

Oh, and if anyone was wondering, my internet problems (internet was pretty much slower than the slowest dialup) has now been resolved.

Written by - Visit Website

Posted in Theme Labs | No Comments »