• 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

Infinity Pro – Exclude "Team Member" Page from Displaying Full Width Image

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 › Infinity Pro – Exclude "Team Member" Page from Displaying Full Width Image

This topic is: resolved

Tagged: Infinity Pro, team template

  • This topic has 7 replies, 3 voices, and was last updated 4 years, 3 months ago by rshill65.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • October 20, 2018 at 8:45 pm #223884
    rshill65
    Participant

    I edited the Infinity Pro theme to include a full width image above the page content using a tutorial by Ben Weiser.

    https://benweiser.com/how-to-add-a-full-width-image-above-page-content-in-genesis/

    Here is my problem. As great as this edit is, the Team Member template also uses the "Featured Image" thumbnail to display the Team Page Grid, but unfortunately the featured image thumbnail also displays as a full width image above the page content.

    Example Page: http://www.infinitemindpublishing.com/proofs/STI/about-us/steel-tower-team/elizabeth-urish-walton/

    Here is the code I used. I need to find a way to exclude the post thumbnail from the Team page template.

    //Add hero image above post/page content

    // Create new image size for our hero image
    add_image_size( 'hero-image', 1600, 660, TRUE ); // creates a hero image size

    // Hook after header area
    add_action( 'genesis_after_header', 'bw_hero_image' );

    function bw_hero_image() {
    // If it is a page and has a featured thumbnail, but is not the front page do the following...
    if (has_post_thumbnail() && is_page() ) {
    // Get hero image and save in variable called $background
    $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' );

    $bgdesktop = $image_desktop[0];
    $bgtablet = $image_tablet[0];
    $bgmobile = $image_mobile[0];

    // You can change above-post-hero to any class you want and adjust CSS styles
    $featured_class = 'above-post-hero';

    I hope this makes sense.

    Thank you.

    http://www.infinitemindpublishing.com/proofs/STI/
    October 20, 2018 at 9:44 pm #223886
    rshill65
    Participant

    I did get the full width featured image to go away using display: none; in my CSS file, but I would honestly like a more elegant solution.

    I am thinking about trying to generate a second "Featured Image" thumbnail. I could call it "Above Content" thumbnail and use that instead.

    October 21, 2018 at 4:46 am #223890
    andytc
    Participant

    I can tell you the reason it's appearing above the content - in the code , it's this bit -

    // Hook after header area
    add_action( 'genesis_after_header', 'bw_hero_image' );

    You could try shifting it around by changing the hook. One example below -

    // Hook after header area
    add_action( 'genesis_before_entry', 'bw_hero_image' );

    You can view page hooks here visually -

    https://genesistutorials.com/visual-hook-guide/sample/

    also to note , that code is adding the image as a 'Background' not an inline image.

    October 21, 2018 at 8:30 am #223896
    Brad Dalton
    Participant

    You can use conditional tags to exclude/include page types. https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

    Your code uses is_page.

    This should be changed to something like, is_singular('page')

    Or

    Something like ! is_page_template('slug') where slug is the name of your template


    Get Help – Book Consultation.

    October 21, 2018 at 2:45 pm #223899
    rshill65
    Participant

    Thank you for your reply. I understand why it is showing up, but I also needed to exclude the Featured Image thumbnail from the Team Pages.

    October 21, 2018 at 2:47 pm #223900
    rshill65
    Participant

    Thank you Brad Dalton that is helpful to know.

    October 22, 2018 at 2:18 am #223904
    Brad Dalton
    Participant

    Thats another question. Please start another topic for your 2nd question.


    Get Help – Book Consultation.

    October 22, 2018 at 9:56 am #223911
    rshill65
    Participant

    sure thing

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Infinity Pro – Exclude "Team Member" Page from Displaying Full Width Image’ 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