• 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

Executive Theme – Add page title to Portfolio archive

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 › Executive Theme – Add page title to Portfolio archive

This topic is: resolved

Tagged: executive portfolio page title

  • This topic has 8 replies, 2 voices, and was last updated 13 years, 5 months ago by Brad Dalton.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • April 27, 2013 at 5:04 am #38032
    Susan Nelson
    Participant

    I'm using Executive 2.0 and I would love to add the page title of "Portfolio" to the top of the portfolio archive page. As you can see, the demo does not include the page title.

    Here's what's included in archive-portfolio.php:

    <?php
    /**
     * The custom portfolio post type archive template
     */
    
    /** Force full width content layout */
    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    
    /** Remove the breadcrumb navigation */
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
    
    /** Remove the post info function */
    remove_action( 'genesis_before_post_title', 'genesis_post_info' );
    
    /** Remove the post content */
    remove_action( 'genesis_post_content', 'genesis_do_post_content' );
    
    /** Remove the post image */
    remove_action( 'genesis_post_content', 'genesis_do_post_image' );
    
    /** Add the featured image after post title */
    add_action( 'genesis_post_title', 'executive_portfolio_grid' );
    function executive_portfolio_grid() {
    	if ( has_post_thumbnail() ){
    		echo '<div class="portfolio-featured-image">';
    		echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'portfolio' );
    		echo '</a>';
    		echo '</div>';
    	}
    }
    
    /** Remove the post meta function */
    remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
    
    genesis();
    

    I've fiddled around with this code, but nothing I've tried works. Help? Thanks!

    April 27, 2013 at 5:46 am #38034
    Brad Dalton
    Participant

    Hello Susan.

    Please link to the exact portfolio page in question and i will provide the custom function.

    I need to grab the page i.d

    It will be something like this and there's different ways to do this also.

    Code not displaying? Grab it on Github.


    Tutorials for StudioPress Themes.

    April 27, 2013 at 6:20 am #38043
    Susan Nelson
    Participant

    Hi Brad,

    I can't provide a link just yet, so would it be possible for you to use the demo as an example? And there isn't a page id since this is a custom post type. There's no Portfolio page in the admin.

    Here are the body classes for the archive:

    <body class="archive post-type-archive post-type-archive-portfolio logged-in custom-header header-image header-full-width full-width-content">
    
    April 27, 2013 at 6:25 am #38047
    Brad Dalton
    Participant

    I'll need to test which conditional works with the post-type-archive-portfolio so thats the solution you can try and then add the code in the conditional above if you like.

    if( is_page_template('archive-portfolio.php') )
    

    This should work according to the Codex but it doesn't. http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template


    Tutorials for StudioPress Themes.

    April 27, 2013 at 6:42 am #38052
    Brad Dalton
    Participant

    Got it Susan. The Codex is a little bit off.

    And i also updated the first code snippet above which also works but this one is probably better.

    Code not displaying? Grab it on Github.


    Tutorials for StudioPress Themes.

    April 27, 2013 at 6:59 am #38054
    Brad Dalton
    Participant

    Whooops! Looks like its close but not quite the archive. Let me work on this for awhile.


    Tutorials for StudioPress Themes.

    April 27, 2013 at 8:39 am #38067
    Brad Dalton
    Participant

    Actually the conditional tag is correct but the hook needs to be changed to genesis_after_header otherwise the titles will be added to all portfolio items rather than just the portfolio archives page.

    I have updated the code above and suggest you use the first snippet for a single portfolio.


    Tutorials for StudioPress Themes.

    April 27, 2013 at 9:13 am #38072
    Susan Nelson
    Participant

    Brad, I cannot thank you enough for your generosity! This works perfectly with a little CSS help:

    function add_portfolio_page_title() {
    if ( is_post_type_archive( 'portfolio' ) )
        echo '<h1 class="entry-title">Portfolio</h1>';
    };
    add_action('genesis_before_content', 'add_portfolio_page_title');
    

    I changed the hook to genesis_before_content and it's just perfect.

    Thanks so much!
    Susan

    April 27, 2013 at 9:19 am #38073
    Brad Dalton
    Participant

    No worries Susan.

    I added the styling in the code and updated it.

    Couldn't use the genesis_post_title hook for some reason.


    Tutorials for StudioPress Themes.

  • 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

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