• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

The Cre8tive Diva - WordPress Developer

Digital Nomad | Helping WordPress & Genesis Framework Website Owners All Over the World

  • Home
  • About
    • Terms of Service & Privacy
    • Accessibility
  • Services
    • Blogger to WordPress Migration
    • Buddypress Installation
  • My Work
  • Blog
    • Tutorials
    • Five on Friday
    • Genesis Framework
    • Tipsy Tuesday
    • WordPress
  • Contact
Home » Add Full Width Featured Image on Pages Using Gallery Pro

Add Full Width Featured Image on Pages Using Gallery Pro

Gallery Pro is a very popular child theme for the Genesis Framework. One of the frequently asked questions by clients, as well as technical support requests, has been how to add the featured image as a full width hero image to Pages the same way it can be done on Posts. This functionality currently does not exist in Gallery Pro. Below is the code you can use to display a full width hero image on your pages.

If you are unfamiliar with working with your theme files, stop and ask for help. If you are familiar with modifying your theme files – you should back them up before proceeding.

Click “View Raw” at the bottom of the code box below. Then browse over to the Gallery Pro theme folder. Open up your functions.php file. Copy/paste the code below at the bottom of the file and save it.

If you are savvy at modifying your code in the dashboard, you can browse to Appearance > Editor. Open the functions.php file, then copy/paste the code at the bottom, then save it.

// Add Featured Hero Image to Pages in Gallery Pro
add_action( 'genesis_after_header', 'c8d_gallery_display_featured_image' );
function c8d_gallery_display_featured_image() {
if ( ! is_singular( array( 'page' ) ) ) {
return;
}
if( has_post_thumbnail( ) ) {
//* Remove the entry header markup (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
//* Remove the entry title (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
//* Remove the entry meta in the entry header (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
//* Remove the post format image (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 );
$image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
echo '<div class="hero flexible-widget-area bg bg-scrim text-center" style="background-image: url(' . $image[0] . ');"><div class="wrap">';
genesis_entry_header_markup_open();
genesis_do_post_title();
genesis_post_info();
genesis_entry_header_markup_close();
echo '</div></div>';
}
}
view raw functions.php hosted with ❤ by GitHub
  • Like my Signature? Get the Signature Widget for Genesis right here!

  • FacebookTweetPinPrintShares16

    Filed Under: Genesis Framework, Genesis Themes, Tutorials

    A recent conflict was found when Genesis Simple Share is activated and configured while using the Posts and Page Grid in Genesis Blocks. The error can be seen when viewing the content on the front end. The error does not display in edit mode. Below is a temporary fix that will allow you to manually set […]

    Primary Sidebar

    It's just me and my dog Bella. I am a freelance web developer at Cre8tiveDiva.com. I build websites using WordPress and the Genesis Framework, WooCommerce and provide troubleshooting and support. I also build with Shopify. I love chocolate, lots of coffee!

    Sign Me Up!

    Receive my blog posts, tips and updates delivered to your inbox!

    Yes, Sign Me Up

    *By signing up you will receive new blogs, updates on products, services and important alerts.

    Categories

    • Design
    • eCommerce
    • Five on Friday
    • Fonts
    • Free Themes
    • Freebie Friday
    • Genesis Framework
    • Genesis Plugins
    • Genesis Themes
    • Genesis Untapped
    • Instagram
    • MailChimp
    • News
    • Plugins
    • Press This News
    • Social Media
    • Tipsy Tuesday
    • Troubleshooting
    • Tutorials
    • Uncategorized
    • Web Development
    • WooCommerce
    • WordPress
    • WordPress Plugins

    Footer

    Digital Nomad! I can be anywhere I wanna be now.

    Latest Blog Posts

    • Temporary Fix When Using Genesis Blocks Posts and Page Grid with Genesis Simple Share
    • How to Add Reading Time to a WordPress Genesis Child Theme Without a Plugin
    • How to Add “Shop” to WooCommerce Breadcrumbs when Using Yoast

    Looking for Something?

    Copyright © 2012–2022 · Designed with by Me! · Hosted on SiteGround

    We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy policy