[Plugin: Simple Section Navigation Widget] Showing a Different Sidebar
-
There are certain posts where I want to show the sidebar that would be appear on a different page. For example, on each individual news story I would like to sidebar that would normally show for the page listing the news to show. To do this I used the following code:
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query('page_id=37');
$wp_query->the_post();get_sidebar();
$wp_query = null;
$wp_query = $temp;
wp_reset_postdata();Do you think this is the best way to do this? Is there a better way to show the sidebar for a particular page within single.php?
Thank you.
- The topic ‘[Plugin: Simple Section Navigation Widget] Showing a Different Sidebar’ is closed to new replies.