Hide Meta Data from Specific Posts

Community Forums Forums Design Tips and Tricks Hide Meta Data from Specific Posts

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  31fss 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #99869

    31fss
    Participant
    Post count: 3

    The way that I am putting together my employer’s website includes a sticky post at the top of each archive page. I am using the WordPress plugin “Category Sticky Post” to accomplish this. The plugin works as advertised, but I do not know how to remove the metadata from the sticky posts. From what I have gathered, it is more of something that would have to be addressed in the theme’s php files. Or maybe I’m not understanding the relationship between the the theme and plugin. Agh.

    I have tried lots of different approaches, and nothing works. I don’t know if I’m simply doing things incorrectly, if the approaches used do not work with the Genesis framework, etc.

    My question is similar to thesaraheffect’s question, but it’s not quite the same. How would I accomplish removing metadata from only specified posts?

    http://31fss.com/31FSS/labellavista
    #99871

    Lauren @ OnceCoupled
    Member
    Post count: 608

    Bill’s second answer (to thesaraheffect’s question) would do this for you. :)

    You would run a conditional for if the post is sticky and remove the meta data if true.

    https://codex.wordpress.org/Function_Reference/is_sticky

    Best,
    Lauren


    I do custom WordPress work! http://oncecoupled.com
    Contact me directly: lauren@oncecoupled.com

    #100684

    31fss
    Participant
    Post count: 3

    I tried this, but I think that it doesn’t work because the “sticky” posts created by the Category Sticky Posts plugin don’t use the “is_sticky” function.

    Is there some way that I can identify a post by its post id and then say (in code of course) that I don’t want that post’s meta data to appear? I’ve tried a couple ways to do this, such as:

    .post-376 .entry-meta {
    display: none;
    }

    But I think that didn’t work because the post is wrapped in this div:

    <div class=”content-sidebar-wrap”>
    <main class=”content” itemtype=”http://schema.org/Blog” itemscope=”itemscope” itemprop=”mainContentOfPage” role=”main”>
    <article class=”post-376 post type-post status-publish format-standard category-labellavista entry” itemprop=”blogPost” itemtype=”http://schema.org/BlogPosting” itemscope=”itemscope”>
    </main>
    <aside class=”sidebar sidebar-primary widget-area” itemtype=”http://schema.org/WPSideBar” itemscope=”itemscope” role=”complementary”></aside>
    </div>

    I just want to have a description (without meta data) above the posts in a category archive page that sits beside the sidebar like a normal post. I will try any method at all. I keep trying ways to remove meta data from a specific post, and then assigning that post the “sticky” post for a category – maybe I need to try something else.

    I have tried using Genesis Extender to create a new widget area under the header containing a div with the category’s information, but it pushes down the entire layout. In the past I had put a Genesis slider in that same hook area, and as long as it’s size didn’t exceed a certain width, the sidebar stayed aligned to the navigation area. So, for this, I tried giving the div I used a maximum width, to no avail.

    #100696

    Lauren @ OnceCoupled
    Member
    Post count: 608

    If you want to go the CSS route to hide the date on each post, you could normally use:

    .category-sticky .entry-header .entry-meta {
         display: none;
    }

    However, it looks like your date has been moved outside the meta, so you’d need to use something like:

    .category-sticky .entry-header h4 .entry-time {
         display: none;
    }

    I do custom WordPress work! http://oncecoupled.com
    Contact me directly: lauren@oncecoupled.com

    #100906

    31fss
    Participant
    Post count: 3

    !!! This works!

    I know it sounds over the top, but I am SO grateful to you for helping me with this. I don’t think I realized when I told my employer, “Sure, I’ll do that!” just how in over my head I was getting.

    Thank you so much!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Hide Meta Data from Specific Posts’ is closed to new replies.