Is it possible?
I’m not super well versed in PHP but it looks like it may be somehow plausible to make a definition within sidebar.php that tells it:
“If this single post using template single.php is under catergoy 4 use image 4.jpg in the sidebar.
If this is using category-5.php use image 5.jpg in the sidebar.
If this is using index.php use image 0.jpg in the sidebar.”
is there a coding function that can do something like this?
the only thing I can think of is not using the sidebar.php file at all and just manually editing the code in each respective template (which would make all single posts use the same image instead of the image of thier category which would be sad but doeable) and that would just take a really long time.
- The topic ‘Sidebar Content That Changes Depending On The Category?’ is closed to new replies.