• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Education theme – hide tags and categories from visitors

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Education theme – hide tags and categories from visitors

This topic is: resolved

Tagged: hide categories, hide tags

  • This topic has 5 replies, 2 voices, and was last updated 12 years, 10 months ago by Marc Tibesar.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • January 16, 2013 at 8:26 pm #12527
    Marc Tibesar
    Member

    I want to hide all tags and categories in my Posts and Excerpts from site visitors:

    If logged in:  display tags and categories
    If logged out :  do NOT display tags and categories in the Posts and Excerpts

    I tried this code in the functions.php but it did not work:

    if ( is_user_logged_in() ) {
    $post_meta = '[post_categories] // [post_tags]';
    } else {
    $post_meta = 'logged out';
    }
    return $post_meta;

    I am not a php developer so I would appreciate any comments or suggestions. Thank you so much!

    Theme: Education
    Site: tibesar.com

    January 17, 2013 at 12:17 pm #12662
    cdils
    Participant

    Hi there,

    You'll need to use the genesis_post_meta filter. Try something like this in your functions.php. You'll notice it's basically your same code above, but it needs to be wrapped in a function and read in via a filter.

    /** Customize the post meta function */
    add_filter( 'genesis_post_meta', 'post_meta_filter' );
    function post_meta_filter($post_meta) {
    if ( is_user_logged_in() ) {
        $post_meta = '[post_categories] // [post_tags]';
        return $post_meta;
    }}


    Carrie


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂

    I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.

    January 17, 2013 at 2:03 pm #12708
    Marc Tibesar
    Member
    This reply has been marked as private.
    January 17, 2013 at 2:10 pm #12711
    cdils
    Participant

    Once you throw an error in functions.php, it's impossible to edit any further in the WP dashboard. You'll need to access the file via FTP and remove the code that way. That should reset you.

    Before adding in this code, make sure you remove your previous code so it doesn't throw another error. 🙂

    Not directly related, but still helpful... You might like this article (http://surefirewebservices.com/wordpress/how-to-use-remove_action-with-conditional-tags). It explains the why of using functions.


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂

    I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.

    January 17, 2013 at 2:12 pm #12713
    Marc Tibesar
    Member
    This reply has been marked as private.
    January 17, 2013 at 8:11 pm #12778
    Marc Tibesar
    Member

    Good evening Carrie,

    The code you provided works great.

    This code should be added to the Genesis snippets library.

    Hiding tags is a significant security enhancement to private Genesis websites.

    Accordingly, you have enhanced the security of our archives and, we appreciate your contribution and sharing.

    Cheers!

    Marcus Tibesar

    The Tibesar Archives

    http://tibesar.com

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Education theme – hide tags and categories from visitors’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble