I am smashing my head against some code.
Here is the situation:
I have one post in 3 different categories, this post has to be visible in “category 1” with the single1.php, in “category 2” with single2.php and in “category 3” with single3.php.
Obviously the 3 single.php pages have a different template inside.
For example the single1.php shows pictures and the_content(); single2.php shows pictures and comments; single3.php shows the reviews.
I know that in single.php I can use the if/else but I cannot figure out if the same post is in 3 different categories.
Any help please?
Instead of making it category specific you could use post formats and use different content-templates. In single.php you can write
Then create different post formats
Then create different post templates content-withpictures.php, content-withcomments.php
When creating content the chosen post format will determine the template.
You can use the filter hook for ‘single_template’. Create single-cat1.php, single-cat2.php and single-cat3.php (cat1, cat2 and cat3 are the category names should be replaced by your category names)
You can change it on header.php
if template using single-cat1.php, header.php must change style sheet
Ex: