Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customizing Post Info
- This topic has 7 replies, 2 voices, and was last updated 10 years, 11 months ago by patpetro.
-
AuthorPosts
-
April 8, 2013 at 8:43 am #33977patpetroMember
Is there a way to customize the post info so that the info does not appear on posts in one specific category?
April 8, 2013 at 11:58 am #34039Brad DaltonParticipantUse PHP with a conditional tag or css. http://my.studiopress.com/snippets/post-info/
Example:
.category-web-design .post-info { display: none; }
April 8, 2013 at 2:28 pm #34089patpetroMemberI already have the conditional tag in my child theme; and if I use the CSS "display: none," the post info disappears on all posts in all categories. I was hoping there was a way to add an "if in_category ()" to the conditional tag that would affect just the one category. I tried to do it on my own, but not knowing much about PHP, it didn't work.
April 8, 2013 at 2:33 pm #34091Brad DaltonParticipantThe CSS hides it only on one category.
What code do you have in your child theme?
Change the conditional tag for one category.
What category is it?
Can you link to your site please.
April 8, 2013 at 6:39 pm #34166patpetroMemberSorry for my lack of knowledge. This is my first Genesis site, and I'm trying to wrap my head around customizing it using functions. If it was HTML, I would know exactly what to do.
My website is at http://www.patpourri.com.
Originally, I was trying to remove the post info from posts in the "recipes" category. However, after thinking about it, I would prefer to leave the post info in, but eliminate just the date in post info on posts in both the "recipes" and "poems" categories.
Is this possible? The code I have in the child theme is:
/** Customize the post info function */
add_filter( 'genesis_post_info', 'innov8tive_post_info_filter' );
function innov8tive_post_info_filter( $post_info ) {
return 'By [post_author_posts_link] [post_date before=" on "] | [post_tags before="Filed under "] | [post_comments]';
}April 9, 2013 at 5:24 am #34243patpetroMemberI removed the post info from the two categories using the CSS you provided, and I'm satisfied. I don't understand fully why it worked, but I like that it did and that it was such an easy fix.
I am curious though . . . is there something I can add to the CSS that would target just the date on the post info?
Thanks for all your help.
April 9, 2013 at 10:41 am #34289Brad DaltonParticipantThe class for the date would.
.post-info .date { display: none; }
And then you can use the post i.d which you can grab from the source code or the category i.d to hide the date on posts in one or more categories.
I suggest you install Firebug for Firefox and inspect each element which will give you the class and enable you to modify the code in real time using your browser before editing the code in your child themes files.
April 9, 2013 at 4:26 pm #34396patpetroMemberBrad, you are the best!
I used this:
.category-poems .post-info .date,
.category-recipes .post-info .date {
display: none;
}
Worked like a charm. I will install Firebug. Thanks for the suggestion . . . and thanks again for all of your help.
Patricia
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.