Below is the code to swap post title and image position on an archive page in Genesis.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
} |
Below is the code to swap post title and image position on a custom post type archive page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
} |