Last active
June 1, 2017 16:13
-
-
Save jpmarchand/83ac754e292bbf3f700f to your computer and use it in GitHub Desktop.
Swap post title and image position on archive page in Genesis. Source: https://wpbeaches.com/swap-post-title-image-position-archive-page-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); | |
} | |
} |
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment