/ Published in: PHP
wordpress in subcategory
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function is_subcategory ($id) { $in_subcategory = false; if( in_category($child_category) ) { $in_subcategory = true; } } return $in_subcategory; } ?> <?php if ( is_category(1) || is_subcategory(1) ) { ?> ....LOOP.... <?php } ?>