Function – Agency_post_image

Community Forums Forums General Discussion Function – Agency_post_image

This topic is: resolved

This topic contains 18 replies, has 2 voices, and was last updated by  genevishgraphics 5 months ago.

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #74073

    nutsandbolts
    Moderator
    Post count: 2615

    Ah, I don’t know why I didn’t see that before – that function is actually saying “Don’t do this on the homepage, but only on single posts.”

    You could remove the function (which would also remove the featured image on posts) or you could alter it to exclude pages:

    /** Add Post image above post title, single posts only */
    add_action( 'genesis_before_post', 'agency_post_image' );
    function agency_post_image() {
    if ( is_front_page() || is_page() ) return;
    if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
    printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    }
    }

    Note – that’s untested (I don’t have Runway loaded on any of my test sites) so there’s the potential for something to break if my syntax is wrong. Be sure you have FTP or CPanel access to functions.php before you try that in case it needs to be changed back. If it doesn’t work, let me know and I’ll load the theme and try before I start pasting code in here. :)


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #74075

    genevishgraphics
    Participant
    Post count: 49

    Worked great, whew! I just knew it had something to do with that function, still learning conditional statements :)
    Thanks for sticking around to help!!

    #74076

    nutsandbolts
    Moderator
    Post count: 2615

    No problem! Sorry it took so long – this could have been solved 10 posts ago if I’d been reading carefully enough.

    If you don’t mind, please mark this topic as resolved so we’ll know you’ve been helped. :)


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #74077

    genevishgraphics
    Participant
    Post count: 49

    Thanks!!

Viewing 4 posts - 16 through 19 (of 19 total)

The topic ‘Function – Agency_post_image’ is closed to new replies.