tmeyer45458
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: Single.php based on Category/Child CategoryThe solution:
<?php $in_subcategory = false; foreach( (array) get_term_children( 11, 'category' ) as $child_category ) { if(in_category($child_category))$in_subcategory = true; } if ( $in_subcategory || in_category( 11 ) ) { echo '<span class="fruits">This is about different kinds of fruits</span>'; } else { echo '<span class="bad-cat">Not tasty! Not healthy!</span>'; } ?>Figures I find the answer right after asking for help 🙂 Hope this helps someone else!!
Forum: Plugins
In reply to: Single.php based on Category/Child CategoryThe solution:
<?php $in_subcategory = false; foreach( (array) get_term_children( 11, 'category' ) as $child_category ) { if(in_category($child_category))$in_subcategory = true; } if ( $in_subcategory || in_category( 11 ) ) { echo '<span class="fruits">This is about different kinds of fruits</span>'; } else { echo '<span class="bad-cat">Not tasty! Not healthy!</span>'; } ?>Figures I find the answer right after asking for help 🙂 Hope this helps someone else!!
Forum: Fixing WordPress
In reply to: Categories Redirect to HomepageProblem solved. Too embarrassed to say what it was… 🙂 I should have taken a closer look at the code in archives.php before posting.
Forum: Fixing WordPress
In reply to: Categories Redirect to HomepageUpdate: I’ve tried half a dozen themes and in all of them – the categories lead to the desired category and not the homepage.
So my question is: What, in a theme, could cause the category links to redirect to the homepage? I’m at a loss…
Viewing 4 replies - 1 through 4 (of 4 total)