• 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

Full width hero / featured images on Altitude Pro pages and posts

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 › Full width hero / featured images on Altitude Pro pages and posts

This topic is: not resolved

Tagged: full width image, genesis_after_header

  • This topic has 8 replies, 4 voices, and was last updated 8 years, 1 month ago by brightcricket.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • November 8, 2016 at 3:12 pm #195918
    James Roberts
    Member

    I'd like to have the option to run full width images (like the front page) on some of my pages and posts below the top nav and above the page title. Studiopress pointed me to > http://writenowdesign.com/blog/wordpress/wordpress-how-to/add-a-featured-image-to-a-genesis-post-or-page/ < but I'm not sure where in the code I should add it. I tried it once and trashed my site so not keen on trial and error again!

    My functions.php is below if that helps.

    Any pointers will be amazing!

    Thanks,

    James

    <?php
    //* Start the engine
    include_once( get_template_directory() . '/lib/init.php' );
    
    //* Setup Theme
    include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );
    
    //* Set Localization (do not remove)
    load_child_theme_textdomain( 'altitude', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'altitude' ) );
    
    //* Add Image upload and Color select to WordPress Theme Customizer
    require_once( get_stylesheet_directory() . '/lib/customize.php' );
    
    //* Include Customizer CSS
    include_once( get_stylesheet_directory() . '/lib/output.php' );
    
    //* Child theme (do not remove)
    define( 'CHILD_THEME_NAME', 'Altitude Pro Theme' );
    define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/altitude/' );
    define( 'CHILD_THEME_VERSION', '1.0.3' );
    
    //* Enqueue scripts and styles
    add_action( 'wp_enqueue_scripts', 'altitude_enqueue_scripts_styles' );
    function altitude_enqueue_scripts_styles() {
    
    	wp_enqueue_script( 'altitude-global', get_bloginfo( 'stylesheet_directory' ) . '/js/global.js', array( 'jquery' ), '1.0.0' );
    
    	wp_enqueue_style( 'dashicons' );
    	wp_enqueue_style( 'altitude-google-fonts', '//fonts.googleapis.com/css?family=Ek+Mukta:200,800', array(), CHILD_THEME_VERSION );
    
    }
    
    //* Add HTML5 markup structure
    add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
    
    //* Add viewport meta tag for mobile browsers
    add_theme_support( 'genesis-responsive-viewport' );
    
    //* Add new image sizes
    add_image_size( 'featured-page', 1140, 400, TRUE );
    
    //* Add support for 1-column footer widget area
    add_theme_support( 'genesis-footer-widgets', 1 );
    
    //* Add support for footer menu
    add_theme_support( 'genesis-menus' , array( 'secondary' => __( 'Before Header Menu', 'altitude' ), 'primary' => __( 'Header Menu', 'altitude' ), 'footer' => __( 'Footer Menu', 'altitude' ) ) );
    
    //* Unregister the header right widget area
    unregister_sidebar( 'header-right' );
    
    //* Reposition the primary navigation menu
    remove_action( 'genesis_after_header', 'genesis_do_nav' );
    add_action( 'genesis_header', 'genesis_do_nav', 12 );
    
    //* Remove output of primary navigation right extras
    remove_filter( 'genesis_nav_items', 'genesis_nav_right', 10, 2 );
    remove_filter( 'wp_nav_menu_items', 'genesis_nav_right', 10, 2 );
    
    //* Remove navigation meta box
    add_action( 'genesis_theme_settings_metaboxes', 'altitude_remove_genesis_metaboxes' );
    function altitude_remove_genesis_metaboxes( $_genesis_theme_settings_pagehook ) {
    
        remove_meta_box( 'genesis-theme-settings-nav', $_genesis_theme_settings_pagehook, 'main' );
    
    }
    
    //* Reposition the secondary navigation menu
    remove_action( 'genesis_after_header', 'genesis_do_subnav' );
    add_action( 'genesis_header', 'genesis_do_subnav', 5 );
    
    //* Add secondary-nav class if secondary navigation is used
    add_filter( 'body_class', 'altitude_secondary_nav_class' );
    function altitude_secondary_nav_class( $classes ) {
    
    	$menu_locations = get_theme_mod( 'nav_menu_locations' );
    
    	if ( ! empty( $menu_locations['secondary'] ) ) {
    		$classes[] = 'secondary-nav';
    	}
    
    	return $classes;
    
    }
    
    //* Hook menu in footer
    add_action( 'genesis_footer', 'altitude_footer_menu', 7 );
    function altitude_footer_menu() {
    
    	genesis_nav_menu( array(
    		'theme_location' => 'footer',
    		'container'      => false,
    		'depth'          => 1,
    		'fallback_cb'    => false,
    		'menu_class'     => 'genesis-nav-menu',	
    	) );
    
    }
    
    //* Add Attributes for Footer Navigation
    add_filter( 'genesis_attr_nav-footer', 'genesis_attributes_nav' ); 
    
    //* Unregister layout settings
    genesis_unregister_layout( 'content-sidebar-sidebar' );
    genesis_unregister_layout( 'sidebar-content-sidebar' );
    genesis_unregister_layout( 'sidebar-sidebar-content' );
    
    //* Unregister secondary sidebar
    unregister_sidebar( 'sidebar-alt' );
    
    //* Add support for custom header
    add_theme_support( 'custom-header', array(
    	'flex-height'     => true,
    	'width'           => 360,
    	'height'          => 76,
    	'header-selector' => '.site-title a',
    	'header-text'     => false,
    ) );
    
    //* Add support for structural wraps
    add_theme_support( 'genesis-structural-wraps', array(
    	'header',
    	'nav',
    	'subnav',
    	'footer-widgets',
    	'footer',
    ) );
    
    //* Modify the size of the Gravatar in the author box
    add_filter( 'genesis_author_box_gravatar_size', 'altitude_author_box_gravatar' );
    function altitude_author_box_gravatar( $size ) {
    
    	return 176;
    
    }
    
    //* Modify the size of the Gravatar in the entry comments
    add_filter( 'genesis_comment_list_args', 'altitude_comments_gravatar' );
    function altitude_comments_gravatar( $args ) {
    
    	$args['avatar_size'] = 120;
    
    	return $args;
    
    }
    
    //* Add support for after entry widget
    add_theme_support( 'genesis-after-entry-widget-area' );
    
    //* Relocate after entry widget
    remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
    add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );
    
    //* Setup widget counts
    function altitude_count_widgets( $id ) {
    	global $sidebars_widgets;
    
    	if ( isset( $sidebars_widgets[ $id ] ) ) {
    		return count( $sidebars_widgets[ $id ] );
    	}
    
    }
    
    function altitude_widget_area_class( $id ) {
    
    	$count = altitude_count_widgets( $id );
    
    	$class = '';
    	
    	if ( $count == 1 ) {
    		$class .= ' widget-full';
    	} elseif ( $count % 3 == 1 ) {
    		$class .= ' widget-thirds';
    	} elseif ( $count % 4 == 1 ) {
    		$class .= ' widget-fourths';
    	} elseif ( $count % 2 == 0 ) {
    		$class .= ' widget-halves uneven';
    	} else {	
    		$class .= ' widget-halves';
    	}
    
    	return $class;
    	
    }
    
    //* Customize the entry meta in the entry header
    add_filter( 'genesis_post_info', 'altitude_post_info_filter' );
    function altitude_post_info_filter( $post_info ) {
    
        $post_info = '[post_date format="M d Y"] [post_edit]';
    
        return $post_info;
    
    }
    
    //* Customize the entry meta in the entry footer
    add_filter( 'genesis_post_meta', 'altitude_post_meta_filter' );
    function altitude_post_meta_filter( $post_meta ) {
    
    	$post_meta = 'Written by [post_author_posts_link] [post_categories before=" &middot; Categorized: "]  [post_tags before=" &middot; Tagged: "]';
    
    	return $post_meta;
    	
    }
    
    //* Register widget areas
    genesis_register_sidebar( array(
    	'id'          => 'front-page-1',
    	'name'        => __( 'Front Page 1', 'altitude' ),
    	'description' => __( 'This is the front page 1 section.', 'altitude' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-2',
    	'name'        => __( 'Front Page 2', 'altitude' ),
    	'description' => __( 'This is the front page 2 section.', 'altitude' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-3',
    	'name'        => __( 'Front Page 3', 'altitude' ),
    	'description' => __( 'This is the front page 3 section.', 'altitude' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-4',
    	'name'        => __( 'Front Page 4', 'altitude' ),
    	'description' => __( 'This is the front page 4 section.', 'altitude' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-5',
    	'name'        => __( 'Front Page 5', 'altitude' ),
    	'description' => __( 'This is the front page 5 section.', 'altitude' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-6',
    	'name'        => __( 'Front Page 6', 'altitude' ),
    	'description' => __( 'This is the front page 6 section.', 'altitude' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-7',
    	'name'        => __( 'Front Page 7', 'altitude' ),
    	'description' => __( 'This is the front page 7 section.', 'altitude' ),
    ) );
    
    http://total-pitch.com
    November 8, 2016 at 10:38 pm #195922
    Brad Dalton
    Participant

    Are you referring to the featured image added to the featured image meta box on each Edit Post screen or adding a custom image?

    Use the genesis_after_header hook with a conditional tag for each page,

    Or

    Use a custom field to add the image URL with the genesis_after_header hook

    Or

    Use genesis_get_image with the genesis_after_header hook and conditional tags.


    Tutorials for StudioPress Themes.

    November 9, 2016 at 3:44 am #195927
    James Roberts
    Member

    Hi, thanks for the reply.

    I want something like the mock-up below so I'm guessing it would be classed as a custom image? Although happy for it to be classed as a featured image.

    Hero image

    Thanks again,

    James

    November 9, 2016 at 3:51 am #195929
    Brad Dalton
    Participant

    There's at least 3 options

    You could also use backstretch with custom fields or the featured image or hard code the image URL's


    Tutorials for StudioPress Themes.

    November 9, 2016 at 5:11 am #195931
    James Roberts
    Member

    Thanks Brad but I'm none the wiser - I'm a total novice at php as you may have guessed 🙂

    Do you know of any walkthroughs that cover this?

    Cheers,

    James

    November 9, 2016 at 3:42 pm #195964
    anambliss
    Member

    I have Altitude Pro and found the Display Featured Image for Genesis widget does this for me. There were some places that I found with code, but as I'm a novice with php it didn't seem to work for me.

    November 9, 2016 at 10:43 pm #195967
    Brad Dalton
    Participant

    Yes. Using a code editor, copy the PHP code from the view raw link in this post and paste it at the end of your child themes functions file.


    Tutorials for StudioPress Themes.

    November 10, 2016 at 8:36 am #195983
    James Roberts
    Member

    Hi both,

    Thanks for your help, it's really appreciated.

    Patrick from http://writenowdesign.com/ was a great help and we pretty much got there but the plugin suggested by anambliss nailed it without needing to edit any code.

    Thanks again for taking the time to help.

    All the best,

    James

    June 7, 2017 at 1:11 am #207415
    brightcricket
    Participant

    @ anambliss and @JamesRoberts: were you able to get text on top of the image? If so, how were you able to do this?

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 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