How would I am it so on the front end of the single-listing.php that it only shows child categories? Thanks for help.
Hello, Go to Appearance > Menus Create a custom menu and only add those listing categories that you want to show in the sidebar. Now, go to Appearance > Widgets Drag Custom Menu widgets and drop it in the Listing widget area and select your custom menu from select menu option of custom menu widget.
I want to only display child categories in the custom field section. Your solution is for the sidebar. Is there someway to only display child categories in the custom field section? On single-listing.php - this is the code that pulles the categories I am referring to. Goal: only show child categories Code: <?php if ($p_categories): ?> <tr> <td class="label category"><?php echo S_CATEGORY; ?></td> <td><?php echo $p_categories; ?></td> </tr> <?php endif; ?>
Hello again, Open "single-listing.php" file and add code given below as shown in the image. Code: <?php foreach(get_the_terms($post->ID, 'listcat') as $cat) { if($cat->parent) : $term_link = get_term_link($cat->slug, 'listcat'); echo "<a href='{$term_link}'>".$cat->name . "</a>".','; endif; } ?>