/ Published in: PHP
URL: http://www.wprecipes.com/wordpress-hack-choose-the-sidebar-to-use-post-by-post
Expand |
Embed | Plain Text
Simply open single.php* and find the call to the get_sidebar() function: <?php get_sidebar(); ?> Replace it by: <?php $sidebar = get_post_meta($post->ID, "sidebar", true); get_sidebar($sidebar); ?> Now when you'll write a post, create a custom field name sidebar. As a value, give it the name of the sidebar you want to include. For example, if the value given is right, WordPress will automatically inlcude right.php as a sidebar.
You need to login to post a comment.
