/ Published in: PHP
Mostrar un link a una subcategoría, dependiendo de la categoría superior. category_parent es igual al id de la categoría superior. Sirve sólo cuando el post tiene una categoría hija de la categoría superior.
Expand |
Embed | Plain Text
<?php foreach((get_the_category()) as $category) { if($category->category_parent == 193): echo '<em>por <a href="/archives/category/'. $category->category_nicename.'">' . $category->cat_name . '</a></em>'; endif; } ?>
You need to login to post a comment.
