• 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

Display Page title above the hero image in Genesis Sample Theme

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 › General Genesis Framework Discussions › Display Page title above the hero image in Genesis Sample Theme

This topic is: resolved

Tagged: genesis sample theme, hero image, page-title

  • This topic has 1 reply, 2 voices, and was last updated 1 year, 8 months ago by Anita.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 9, 2021 at 1:32 am #503986
    Amol
    Participant

    Hello,

    I have created a Full-width hero image on the genesis sample theme. I am unable to add the Page title above the hero image. Kindly help with the same. Will appreciate the support. Thank you

    
    // Add hero image above page content Start
    
    add_image_size( 'hero-image', 1263, 650, TRUE ); 
    add_action( 'genesis_after_header', 'al_hero_image' );
    
    function al_hero_image() {
        if (has_post_thumbnail() && is_page() ) {
        	$image_desktop = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'hero-image' );
        	$image_tablet = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'large' );
        	$image_mobile = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'medium' );
    
        	$aldesktop = $image_desktop[0];
            $altablet = $image_tablet[0];
            $almobile = $image_mobile[0];
    
        	$featured_class = 'seefresh-al-page-hero';
    
     ?> 
    <div class='<?php echo $featured_class; ?>'></div>
    <style>
    	<?php echo ".$featured_class "; ?> {background-image:url( <?php echo $almobile; ?>);height:193px; margin-top:70px;}
    		
    		@media only screen and (min-width : 480px) {       
            <?php echo ".$featured_class "; ?> {background-image:url(<?php echo $altablet;?>);height:410px; margin-top:70px;}
    		}
    
    		@media only screen and (min-width : 992px) {       
            <?php echo ".$featured_class "; ?> {background-image:url(<?php echo $aldesktop;?>);height:650px; margin-top:70px;}
    		}
    </style>
    <?php
    
        } 
    }
    //Add hero image above page content End
    

    What’s Beneath the Webface

    https://wordpress-159506-1920925.cloudwaysapps.com/about-us/
    May 25, 2021 at 9:41 am #504120
    Anita
    Keymaster

    Since you marked this resolved, I'll close it.


    Love coffee, chocolate and my Bella!

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Display Page title above the hero image in Genesis Sample Theme’ is closed to new replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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