Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Swap Post Title and Image Position on Archive Page in Genesis

October 9, 2014 Leave a Comment

You can swap the order of the post title and thumbnail featured image of a post on an archive page by rearranging the genesis_do_post_image from its default position in the entry content into the entry header, this is done by removing and adding the function in a higher location.

genesis-swap-title-image-archive

In your functions.php add in

function themeprefix_swap_title_image() {
     if ('is_archive') {
		remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
		add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
	}
}
add_action( 'genesis_before_content', 'themeprefix_swap_title_image' );

The code is using PHP conditionals to target an archive page, you could target specific category archive pages. The initial genesis_do_post_image action is set with a priority of 8, so it has to be removed with the same priority, it is then added in the new hook position also with that priority so the image will sit above the post title.

genesis-swap-title-image-archive-after

 

If you only wanted this behavior to appear just on a certain custom post type page archive you can just add some further conditional code:

// Swap image and title on CPT

function themeprefix_swap_title_image_cpt() {
     if ('is_archive' && 'cpt-name' == get_post_type()) {//add in your CPT name
		remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
		add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
	}
}
add_action( 'genesis_before_content', 'themeprefix_swap_title_image_cpt' );

So in the above code, only the archive page of the CPT called ‘cpt-name’ would be affected.

Cats: WordPress

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Discuss

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls
Get DesktopServer

Lynda

Lynda.com Online Training Videos

TreeHouse

smlinks

Learn WordPress
osx-modify-shell-path

How to Add to the Shell Path in macOS Big Sur and Catalina using Terminal

October 19, 2019

virtual-hosts osx 10.10 yosemite

Set up Virtual Hosts on macOS Catalina 10.15 in Apache

October 19, 2019

Installing Homebrew on macOS Catalina 10.15, Package Manager for Linux Apps

October 18, 2019

Where is the bash shell in macos Catalina?

October 12, 2019

Refine your search

  • All
  • Modules
  • Themes
  • Documentation
  • Forums & Issues
  • Groups

RSS ars technica

  • Spotify seizes the day after Apple is forced to allow external payments
  • Apple and Meta furious at EU over fines totaling €700 million
  • After market tumult, Trump exempts smartphones from massive new tariffs
  • Apple silent as Trump promises “impossible” US-made iPhones
  • Apple enables RCS messaging for Google Fi subscribers at last

RSS mac surfer

  • Tot is new text editor for Mac, iPhone, and iPad focused on constraints and ease of use
  • TiPbITS: Google Drive Sorting Can Hide New Documents
  • How to take a screenshot on a MacBook Pro
  • How To Create Simple Animation With Mac Keynote
  • Last Week on My Mac: Virus pandemics

Donate

Copyright © 2025· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2025 · gee on Genesis Framework · WordPress · Log in