Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'wp_head', 'sk_add_archives_image' );
- function sk_add_archives_image() {
- if ( class_exists( 'MultiPostThumbnails' ) ) {
- new MultiPostThumbnails(
- array(
- 'label' => 'Archives Image',
- 'id' => 'archives-image',
- 'post_type' => 'post'
- )
- );
- }
- }
- add_action( 'genesis_before_entry', 'sk_archives_image' );
- function sk_archives_image() {
- // if we are on a single page, abort.
- if ( is_singular() ) {
- return;
- }
- if ( class_exists( 'MultiPostThumbnails' ) && MultiPostThumbnails::has_post_thumbnail( 'post', 'archives-image' ) ) {
- remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
- add_action( 'genesis_entry_content', function () {
- MultiPostThumbnails::the_post_thumbnail( 'post', 'archives-image', null, 'medium', array( 'class' => 'alignleft' ) );
- }, 8 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement