Reply To: Problem with featured image support and Portfolio template

Homepage Community Forums Epik Theme Support Problem with featured image support and Portfolio template Reply To: Problem with featured image support and Portfolio template

#14144
TrishaM
Customer

    Well I got this one resolved, thought I’d post my solution in case anyone else wants to do the same thing (Display a full-width Featured Image at the top of the page for pages that use the Portfolio Template). This puts the image above the Page Title.

    First, backup your page-portfolio.php and keep it somewhere safe. Then open that file in a text editor, and add these lines of code at the top BELOW the Template name:

    
    // Adds Full Width Featured Image above title on Pages that use this Portfolio Template
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    add_action( 'genesis_before_content_sidebar_wrap', 'featured_post_image', 8 );
      function featured_post_image() {
    	the_post_thumbnail('full');
    }
    

    Naturally this assumes that you’ve assigned a Featured Image to the Page that you apply this Template to, and as I’ve done, ensured that the image is a full-width (1140px wide) image.

    Once you’ve updated the Template, you’ll get the full width image below the header and above the Post title, then whatever content you may have on the Page, then the loop that creates the ‘portfolio’ of post or page links.

    I hope someone finds this helpful. 馃檪