Support » Plugins » Show similar children of a category

  • Resolved Lars M


    I’m trying to modify this code to show only the similar children categories assigned
    to a single post. What can I do to this code, so that it excludes the parent category, but includes the children?

    <?php if (is_single()) {
    	if (get_the_category()) {
    		<p>These similar posts from the same categories may be of interest to you:</p>
    		foreach((get_the_category()) as $category) {
    			echo '<h3>Related Posts in '.$category->cat_name.'</h3>'."<ul>";
    			while (have_posts()) {
    				<li><a href="<?php the_permalink() ?>" title="permalink to <?php the_title() ?>"><?php the_title() ?></a></li>
    			echo "</ul>";

    Any help much appreciated!

  • The topic ‘Show similar children of a category’ is closed to new replies.