Remove Post Meta from home page with excerpts

Community Forums Forums General Discussion Remove Post Meta from home page with excerpts

This topic is: not resolved

This topic contains 7 replies, has 3 voices, and was last updated by  braddalton 1 year, 7 months ago.

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

    niftycreations
    Participant
    Post count: 9

    I am trying to add a jpg of my disclosure under the post meta on the posts only. When I use simple hooks I can achieve that, however it also shows up on my homepage under my post meta. Is there anyway to remove the post meta from my home page? Or, is there something different you would suggest using to have it appear on my posts only? I am using the Blissful theme.

    < a href=”http://amomhavingfun.com”>A Mom Having Fun</a>

    Thank you!!

    #19519

    Davinder Singh Kainth
    Participant
    Post count: 1240

    Use following in functions.php

    // remove post meta on homepage

    remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);

    add_action(‘template_redirect’, ‘child_conditional_actions’);

    function child_conditional_actions() {

    if( is_single() ) {

    add_action(‘genesis_after_post_content’, ‘genesis_post_meta’);

    }}


    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #19522

    niftycreations
    Participant
    Post count: 9

    Hi @idavinder,

    I added that code but the post meta is still showing on the homepage. Any other suggestions?

    Thank you!

    #19523

    niftycreations
    Participant
    Post count: 9

    Ahhhh, I just saw the home.php:

    <?php
    /** Add home top widget area */
    add_action( ‘genesis_before_loop’, ‘blissful_home_top’ );
    function blissful_home_top() {
    dynamic_sidebar( ‘home-top’ );
    }

    genesis();

    I added this code:

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

    Which did remove the post meta from the home page, but my jpg is still showing on the home page. I want that to show up only on the post pages.

    Do you have any other suggestions?

    #19534

    braddalton
    Participant
    Post count: 9690

    You can add a widget area to the genesis_after_content area and use the is_single() conditional tag or the Widget Logic plugin so it doesn’t display on any archive pages including the homepage.

    Code: http://pastebin.com/u/braddalton

    Another way is to hide the image on the homepage using CSS code:

    Can you post a link to your site please.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #19696

    niftycreations
    Participant
    Post count: 9

    Hi @braddalton

    The link to my website is: <a href=”http://amomhavingfun.com”>A Mom Having fun</a>

    Thank you!

    #19713

    niftycreations
    Participant
    Post count: 9

    Yay, I got it to work! Thank you @braddalton, your suggestions definitely helped!

    I put:

    <?php if (is_single()) { ?>
    <img border=”0″ src=”http://amomhavingfun.com/wp-content/uploads/2013/02/disclosure1.jpg” /></a>
    <?php } ?>

    Under the genesis_post_content Hook

    Thank you again! So excited!

    #19782

    braddalton
    Participant
    Post count: 9690

    You could also add a widget to that hook easily


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

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

You must be logged in to reply to this topic.