WordPress.org

Ready to get started?Download WordPress

Forums

Hatch
remove category from post meta (6 posts)

  1. lowesmed
    Member
    Posted 1 year ago #

    Thanks for a great theme!

    On the post page there is some meta about which category the post is listed.
    Code:

    <?php echo apply_atomic_shortcode( 'byline_category', '<div class="byline byline-ategory">' . __( 'Category: [entry-terms taxonomy="category"]', 'hatch' ) . '</div>' ); ?>

    How can I exclude categories from this list?

    /Lowe

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    The [entry-terms] shortcode uses get_the_term_list() which doesn't seem to have the exclude argument. Even if you filter that function, still it's a lot to do to accomplish this.

    I'd just use CSS attribute selectors to display none categories that I want excluded.
    https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

  3. lowesmed
    Member
    Posted 1 year ago #

    Ok thanks that worked geat!

    How do i get rid of the "," ?

  4. paulwpxp
    Font hero
    Posted 1 year ago #

    That's impossible with CSS.

    You can, with Child Theme in use, replace that whole templage tag (in your OP) with wp_list_categories(), then you an include, exclude, and do more with your own $args

    http://codex.wordpress.org/Template_Tags/wp_list_categories

  5. cloud4xL
    Member
    Posted 1 year ago #

    @paulwpxp: False.

    Place this somewhere in the "Custom CSS" box in the "Theme Settings" menu:

    .byline.byline-ategory {
    
      display: none !important;
    
    }
  6. paulwpxp
    Font hero
    Posted 1 year ago #

    That only get rid of the whole thing which is not what we are talking about here. We want to get rid of the , (comma) left after when some category is display none via attribute selectors.

    Or maybe I misunderstood the question. But when I hear "exclude" I automatically think that there is some of them not wanted in the list.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.