Community Forums › Forums › Archived Forums › Design Tips and Tricks › Executive Pro | Portfolio Acrhive Page | Move titles below featured thumbnails
Tagged: executive pro, featured image, portfolio, title below image
- This topic has 4 replies, 2 voices, and was last updated 8 years, 3 months ago by
Victor Font.
-
AuthorPosts
-
December 14, 2016 at 7:05 pm #197593
tanyaslogos
MemberGood evening everyone, I hope that everyone is having a wonderful week!
On the portfolio archive page there is a grid of thumbnails with page titles above each thumb. I would like to move these titles to below the image.
I have found a few code snippets on here and the web but so far nothing seems to deliver the results that I would like.
The first code I found doubled all the thumbs and placed the titles between the doubled images.
The second code I found moved the title but it also moved the title on the single portfolio post page to the bottom of the page.
The third removed all the images completely.....Not sure if I am doing something wrong of the code is outdated but I would love it if someone could help me.
I found this snippet in the archive-portfolio.php file and I am almost positive that the secret to this being a success lies within. I just don't know enough php to make it work.
//* Add the featured image after post title add_action( 'genesis_entry_header', 'executive_portfolio_grid' ); function executive_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' ) ); } }
I would also love to change the word "portfolio" to staff or our staff - I am guessing the best way to do that would be to find and replace all instances of the word "portfolio" with the word "staff" or "our staff" on the child theme but maybe not?
Your help and guidance would be greatly appreciated forever and ever!
Sincerely,
TanyaDecember 14, 2016 at 11:18 pm #197598Victor Font
ModeratorYou are on the right track. Both the post title and image are displayed in the entry header. As Genesis/WordPress loads them, they are added to the global $wp_filter array by add_actions with the same priority. This means first come, first display as they are stacked . You can change this behavior by changing the priority of the one that you want to come first. The default priority in WordPress for all add_actions is 10. The way Executive Pro is setup, both the post title and archive image use the default.
If you want to display the image before the title, you have to change the priority so the image is loaded before the defaults. Adding a priority between 5 and 10 will give you what you want. Change the add_action line in archive-portfolio.php to read:
add_action( 'genesis_entry_header', 'executive_portfolio_grid', 8 );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 15, 2016 at 11:31 am #197639tanyaslogos
MemberVictor Font - You are a BEAUTIFUL MAN with a BEAUTIFUL MIND!!!!! I cannot thank you enough for taking the time to explain that to you.
You are the BEST!
I hope you have a wonderful Holiday and a very Happy New Year!
:: doing a snoopy dance ::
December 15, 2016 at 1:26 pm #197648tanyaslogos
Membercorrection: should have said "explain that to me"... brain and fingers are apparently incommunicado today.
December 16, 2016 at 5:39 am #197678Victor Font
ModeratorThank you,
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.