Post Info & Excerpts on Teasers & Featured Posts

Community Forums Forums Design Tips and Tricks Post Info & Excerpts on Teasers & Featured Posts

This topic is: resolved

This topic contains 12 replies, has 2 voices, and was last updated by  handsonaswegrow 1 year, 3 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #33955

    handsonaswegrow
    Participant
    Post count: 31

    I would like the post_info to be remove from the homepage teasers (date would actually be great to keep there) and then on the posts to only have the post_author – I have created the code:

    /** Remove the post meta function */
    remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );

    /** Customize the post info function */
    add_filter( ‘genesis_post_info’, ‘post_info_filter’ );
    function post_info_filter($post_info) {
    if ( !is_single () ) {
    $post_info = ‘By [post_author_posts_link] [post_edit]‘
    return $post_info;
    }}
    add_filter( ‘genesis_post_info’, ‘post_home_info_filter’ );
    function post_home_info_filter($post__home_info) {
    if ( !is_home () ) {
    $post_home_info = ‘[post_date] [post_edit]‘;
    return $post_home_info;
    }}
    But it’s not quite working for me. It takes away the post_info on the homepage altogether and just the date shows on the posts. Not quite what I was looking for, but I’m getting closer.
    Another question I have… I’d like to remove the excerpts on teasers only (and keep the excerpt on the 1 feature post on the homepage). I have found the code to change the length of teasers and I can remove them by using 0 – but I lose the excerpt on the feature too.
    I think that’s all I have for now. And please let me know if I’m overstepping our relationship by asking you these. I can’t find anything in searching.
    I’m using the Genesis-Sample child theme. My site is http://handsonaswegrow.com

    #34313

    braddalton
    Participant
    Post count: 8880

    Could you remove the PHP code so the post info displays. Its easier to use CSS code for this.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #34318

    handsonaswegrow
    Participant
    Post count: 31

    Brad – I sure can. How do I adjust it with CSS?

    #34327

    braddalton
    Participant
    Post count: 8880

    Install Firebug and target the post-info date and author classes using the body class for the home page and posts from the source code.

    http://www.studiopress.com/forums/topic/customizing-post-info/#post-34289


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #34328

    handsonaswegrow
    Participant
    Post count: 31

    Brad – but how can I do that to apply to home differently than the posts themselves?

    #34330

    braddalton
    Participant
    Post count: 8880

    body class

    its hard to test on your site because you have removed most of the post info


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #34350

    handsonaswegrow
    Participant
    Post count: 31

    okay, I’ve removed it from my php file and put .post-info and .post-meta to display:none in my css, but I’d like some elements to show on posts (post-meta) and just the date to show on the home page (and archives) How can I tell that the difference with css?

    #34370

    braddalton
    Participant
    Post count: 8880

    Can’t because they’re not displaying so i can’t inspect them using Firebug.

    You need to test this using Firebug first before making the changes in your child themes files.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #34615

    handsonaswegrow
    Participant
    Post count: 31

    okay, I’ve removed the display:none – thought i hate how this looks in the meantime, I hope we can figure this out quickly.

    #34621

    braddalton
    Participant
    Post count: 8880

    You’ll need to install Firebug and find the different classes for each post info class you want to hide:
    [css]
    .home .post-comments {
    display:none;
    }

    .single-post .post-comments {
    display:none;
    }
    [/css]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #34623

    handsonaswegrow
    Participant
    Post count: 31

    Thank you, I figured it out. Could never find .home and .single-post elements when using Firebug, so I just tried it and that worked. Thank you.

     

    CSS I added to remove post info for comments (from both home and posts), remove date on single posts and remove post-meta from home:

     
    .home .post-comments {
    display: none;
    }

    .home .post-meta {
    display: none;
    }

    .single-post .post-comments {
    display: none;
    }

    .single-post .post-info .date {
    display: none;
    }

    #34624

    handsonaswegrow
    Participant
    Post count: 31

    Brad – I guess I snuck another question in here too – is there a way to remove excerpts from teasers (and not features)? on the homepage and archives?

    #34633

    handsonaswegrow
    Participant
    Post count: 31

    And I figured that out with CSS too – for mine it was:

     

    .one-half .entry-content {
        display: none;
    }

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

The topic ‘Post Info & Excerpts on Teasers & Featured Posts’ is closed to new replies.