Getting category sidebars to display on those category’s posts
-
Need a little coding help….
I have created different sidebars for each of my category pages and I would like the posts in a specific category to display the corresponding category sidebar. Right now, the single.php file pulls in the default sidebar.
I’m assuming I have to create a series of if statements, something like:
?php if (is_category(6) get_sidebar(‘Business Sidebar’);
if (is_category(4) get_sidebar(‘Travel Sidebar’); ?Or maybe something with a Custom Field?
… any help would be appreciated.
my site is here http://thecostaricanews.com if that helps
Thanks in advance.
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
- The topic ‘Getting category sidebars to display on those category’s posts’ is closed to new replies.