Home / Archive / Add Featured Image
Duplicate Snippet

Embed Snippet on Your Site

Add Featured Image

Add a featured image to the individual campaign pages.

Code Preview
php
<?php
/**
 * Add a featured image to the individual campaign pages.
 *
 * @param   Charitable_Campaign $campaign
 */
function en_add_campaign_featured_image( Charitable_Campaign $campaign ) {
    if ( has_post_thumbnail( $campaign->ID ) ) {
        the_post_thumbnail( $campaign->ID );
    }
}
add_action( 'charitable_campaign_content_before', 'en_add_campaign_featured_image', 2 );

Comments

Add a Comment