Code and Display Tips for WordPress

3d Animation

Some tips for displaying information in WordPress Templates, including displaying the parent category title with links.

Display parent category with link, useful for creating a custom breadcrumb in WordPress. Simply place this code where you want to show the parent category, code includes the hyperlink.

   $parent_title = get_the_title($post->post_parent);?>
   <a href="<?php echo get_permalink($post->post_parent) ?>"><?php echo $parent_title;?></a>
<?php echo $children;?>