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

Home Forums Calendar Products Events Calendar PRO Add full width header image before template output w/ Genesis Framework

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1085347
    Evan
    Participant

    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"><img src="http://block.wpengine.com/wp-content/uploads/events-text.jpg&quot; alt="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?

    #1086053
    George
    Participant

    Hey Evan,

    I appreciate your reaching out here, but unfortunately we cannot help with code customizations so I will have to close this thread. I’m sorry to disappoint!

    Please see the “Product Support” section of this page to learn about what is allowed on our product support forums → http://theeventscalendar.com/terms

    Best of luck with your project,
    George

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.