Community Forums › Forums › Archived Forums › Design Tips and Tricks › Hide Meta Data from Specific Posts
Tagged: hide metadata, metadata, posts
- This topic has 4 replies, 2 voices, and was last updated 10 years ago by 31fss.
-
AuthorPosts
-
April 12, 2014 at 7:11 pm #9986931fssMember
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/labellavistaApril 12, 2014 at 7:51 pm #99871Lauren @ OnceCoupledMemberBill'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_stickyBest,
Lauren
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
April 16, 2014 at 8:58 am #10068431fssMemberI 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.
April 16, 2014 at 11:01 am #100696Lauren @ OnceCoupledMemberIf 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; }
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
April 17, 2014 at 12:29 am #10090631fssMember!!! 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!
-
AuthorPosts
- The topic ‘Hide Meta Data from Specific Posts’ is closed to new replies.