Add full width header image before template output w/ Genesis Framework

Home Forums Welcome! Pre-Sales Questions Add full width header image before template output w/ Genesis Framework

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1083966
    Evan
    Guest

    My website is on the Genesis Framework and I’ve added the follow to my functions.php to output a full width after_header image on single pages.


    add_action ( 'genesis_after_header', 'bl_featured_image', 9 );
    //* Display Featured image after header
    function bl_featured_image() {

    if ( has_post_thumbnail() && ( is_page() || is_single() ) && 0 === get_query_var( 'page' ) ) {

    // Get the URL of featured image
    $image = genesis_get_image( 'format=url' );

    // Get the alt text of featured image
    $thumb_id = get_post_thumbnail_id( get_the_ID() );
    $alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );

    // If no alt text is present for featured image, set it to Post/Page title
    if ( '' == $alt ) {
    $alt = the_title_attribute( 'echo=0' );
    }

    // Display featured image
    printf(
    '<div class="my-featured-image">%s</div>',
    esc_url( $image ),
    $alt
    );

    }

    }

    I have tried adding the following into the default-theme.php in my child theme directory; and still no luck.


    add_action ( 'genesis_after_header', 'bl_featured_image', 9 );
    function add_month_view_header_img( printf ) {
    if ( ! tribe_is_month() ) return printf;
    // Display featured image
    printf(
    '<div class="my-featured-image">Events Banner</div>',
    esc_url( $image ),
    $alt
    );

    }

    Can anyone assist me with adding the full width header image hooked into the ‘genesis_after_header’ location?

    #1084261
    Brian
    Member

    Hi,

    Thanks for using the Events Calendar.

    Here on the pre-sales forum, I’m afraid we do not provide technical support. I would ask that you take any technical support questions across to our wordpress.org forum – our staff scan it periodically and other community members may also be able to help out.

    The Events Calendar

    Having said that please check out these conditionals that might help:

    https://gist.github.com/jesseeproductions/903f5ca75877b713c674

    Our Themer’s Guide to show you how to modify event templates:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    and we have this guide for Genesis integration too:

    Genesis Framework & Event Submissions

    If you have any further questions please post them on WordPress.org

    Thanks again!

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Add full width header image before template output w/ Genesis Framework’ is closed to new replies.