Jan 3

Sidebars are great because oakley sunglasses outlet they allow you to display a lot of useful info, such as related posts, author info, a blog roll, 125×125-pixel ad spaces and cheap nfl jerseys so on. But sidebars can quickly become very cheap nfl jerseys busy, and readers may be hard-pressed to find what they’re looking for. So, what Oakleys Outlet about having different sidebars available and displaying the most appropriate one for the post?http://vian34.ru

To apply this hack, duplicate your sidebar.php file and fill it with whatever information you would like to appear. cheap ray bans Save the file as sidebar-whatever.php.

Once that’s done, open your single.php* file and find the call to the get_sidebar() function:

1    <?php get_sidebar(); ?>

Replace it with:

1    <?php $sidebar Blizzard = get_post_meta($post->ID, “sidebar”, true);
2    get_sidebar($sidebar);
3    ?>

Now when you write a post, create a custom field named sidebar. ray ban sunglasses Set its value as the name of the sidebar that you want to include. For example, if its cheap jordans online value is right, WordPress will automatically include sidebar-right.php as a sidebar.

If no custom sidebar field is found, WordPress automatically includes cheap China Jerseys wholesale jerseys the default sidebar.

<span style="color: cheap oakleys #ffff00″>*The same can be done with page.php.

This trick is quite simple. The first thing videu we did was look for a custom field named sidebar and get its value as a Fake Ray Bans variable. Then, the wholesale nfl jerseys variable cheap jerseys wholesale is Cheap Jerseys used as a parameter for Cheap Jordans the WordPress function get_sidebar(), which allows us to specify a particular file to use as a sidebar.

Tags: , , , ,

Categories: CMS ,Tips ,Word Press


Comments are closed.