Customizing Post Info

Community Forums Forums Design Tips and Tricks Customizing Post Info

This topic is: resolved

This topic contains 7 replies, has 2 voices, and was last updated by  patpetro 1 year ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #33977

    patpetro
    Participant
    Post count: 6

    Is there a way to customize the post info so that the info does not appear on posts in one specific category?

    #34039

    braddalton
    Participant
    Post count: 7473

    Use PHP with a conditional tag or css. http://my.studiopress.com/snippets/post-info/

    Example:

    .category-web-design .post-info {   
    display: none; 
    }
    

    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #34089

    patpetro
    Participant
    Post count: 6

    I 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.

    #34091

    braddalton
    Participant
    Post count: 7473

    The 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.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #34166

    patpetro
    Participant
    Post count: 6

    Sorry 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]‘;
    }

    #34243

    patpetro
    Participant
    Post count: 6

    I 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.

    #34289

    braddalton
    Participant
    Post count: 7473

    The 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.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #34396

    patpetro
    Participant
    Post count: 6

    Brad, 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

     

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

You must be logged in to reply to this topic.