• Hi,
    Sort of new to this, hoping I can get some help. I am using pressplay theme and all of the assigned categories display in the post meta data. However, I would like to exclude one or more categories from displaying there. Any ideas? The categories I do NOT want to display are the Parent: Featured Contributors and the children of that one (the featured contributor’s name, since it is a duplication of the byline in some cases). Here is my blog:
    https://www.plumpub.com/kaimen.

    Any help would be appreciated. I am not afraid to delve into the template tags!

Viewing 3 replies - 1 through 3 (of 3 total)
  • From my notes, something like this?

    <?php
    //in the loop, display categories that are not cat id 44
    $cats = get_the_category($post->ID);
    //echo "<pre>"; print_r($cats); echo "</pre>";
      if ($cats) {
        foreach($cats as $cat) {
          if ($cat->cat_ID != 44) {
            echo '<p> category ' . '<a href="' . get_category_link( $cat->cat_ID, 'post_tag' ) . '" title="' . sprintf( __( "View all posts in %s" ), $cat->name ) . '" ' . '>' . $cat->cat_name.'</a> has ' . $cat->count . ' post(s). </p> ';
          }
        }
      }
    ?>
    Thread Starter dshayne

    (@dshayne)

    Thank you! So, I would just drop this into my index.php page, for instance, under here:
    <div class=”post-meta post-top-meta”>
    <span class=”top-categories”>

    and then just change the cat id#?

    Debbie

    You likely would replace the use of the_category with that code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to NOT display certain categories in post meta data’ is closed to new replies.