Revision: 33897
Updated Code
at October 14, 2010 22:33 by jhonqwerty
Updated Code
<?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; } ?>
Revision: 33896
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 14, 2010 22:31 by jhonqwerty
Initial Code
<?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. 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; } ?>
Initial URL
Initial Description
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.
Initial Title
Wordpress single child category link
Initial Tags
php, wordpress, category
Initial Language
PHP