Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Swap post title and image position on archive page in Genesis. Source: https://wpbeaches.com/swap-post-title-image-position-archive-page-genesis/
<?php
//* Swap post title and image position on archive page
add_action('genesis_before_content', 'customprefix_swap_title_image_archive');
function customprefix_swap_title_image_archive() {
if ( is_archive() || is_home() ) {
remove_action('genesis_entry_content', 'genesis_do_post_image', 8);
add_action('genesis_entry_header', 'genesis_do_post_image', 8);
}
}
<?php
//* Swap post title and image position on CPT archive
add_action('genesis_before_content', 'customprefix_swap_title_image_cpt');
function customprefix_swap_title_image_cpt() {
if ( is_post_type_archive('portfolio') ) { // Replace "portfolio" with your CPT name
remove_action('genesis_entry_content', 'genesis_do_post_image', 8);
add_action('genesis_entry_header', 'genesis_do_post_image', 8);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.