• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Ass full width image before Events Calendar html output via genesis hook

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Ass full width image before Events Calendar html output via genesis hook

This topic is: resolved

Tagged: the events calendar

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 9 months ago by bisonbrah.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 1, 2016 at 12:26 pm #180353
    bisonbrah
    Participant

    Really need some help adding full width image to the slug 'events' created by The Events Calendar plugin 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"><img src="%s" alt="%s" class="aligncenter" /></div>',
    			esc_url( $image ),
    			$alt
    		);
    		
    	}
    
    }

    I have tried adding the following into the default-template.php (events calendar template) in my child theme directory per their input; and still no luck.

    Resources:
    Events Calendar & Genesis Docs
    Events Calendar Themeing Guide

    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" alt="Events Banner" class="aligncenter" /></div>',
    		esc_url( $image ),
    		$alt
    	);
    	
    }

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

    http://block.wpengine.com/events/
    March 1, 2016 at 3:02 pm #180374
    WhiteleyDesigns
    Member

    Hey bisonbrah,

    I have a site I built that is a heavily customized version of The Events Calendar and it is built-on Genesis (https://pondhole.com/) and the homepage customization was done to the default-template.php. Per their documentation I added it to my child theme in new directory called 'tribe-events'. I also had to wrap any code that I wanted only on the home page in:

    <?php if( !is_single() ) : ?>

    ... to ensure it only showed on the home page.

    Note - I also use the Event Rocket plugin to allow me to make the event page the home page (https://wordpress.org/plugins/event-rocket/) so my setup may differ from yours.

    Hope this provides some help. The Events Calendar can be pretty tough to work with, but their support is absolutely spectacular so I would suggest getting on the forums there for some guidance. In my experience they offer one of, if not the best support out there.

    Good luck!

    Matt


    Matt Whiteley – WhiteleyDesigns, GitHub
    Designing, Developing & Creating with WordPress

    March 1, 2016 at 3:05 pm #180375
    bisonbrah
    Participant

    Thanks for the input Matt. Would you mind providing a code snippet for reference?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble