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

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Move Portfolio Archive Entry Titles Below The Featured Image In StudioPress

By default, most portfolio archive pages display the title before the featured image.

title before image

If you want to reposition the title after the image, you can simply by adding a third parameter to the function.

title after image

Here’s the default PHP code you’ll find in the portfolio_archive.php page which displays the featured images below the titles.

//* Add the featured image after post title
add_action( 'genesis_entry_header', 'cpt_portfolio_grid');
function cpt_portfolio_grid() {

    if ( $image = genesis_get_image( 'format=url&size=portfolio' ) ) {
        printf( '<div class="portfolio-featured-image"><a href="%s" rel="bookmark"><img src="%s" alt="%s" /></a></div>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );

    }

}

All you need to do is add a priority number as a 3rd parameter to the end of the first line of code like this:

You can see the number 1 has been added at the end of the action.

add_action( 'genesis_entry_header', 'cpt_portfolio_grid', 1 );

So your entire code snippet will look something like this:

//* Add the featured image after post title
add_action( 'genesis_entry_header', 'cpt_portfolio_grid', 1 );
function cpt_portfolio_grid() {

    if ( $image = genesis_get_image( 'format=url&size=portfolio' ) ) {
        printf( '<div class="portfolio-featured-image"><a href="%s" rel="bookmark"><img src="%s" alt="%s" /></a></div>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );

    }

}

Simply increase the number from 1 to a higher number if needed.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.