Display featured images only on certain pages
-
How would I go about displaying certain additional featured images on certain pages? I am trying to target the post_id but it’s not working as I hoped. Thanks in advance for any direction. (I am using Multiple Featured Images plugin as a starting point.)
functions.php:
if( class_exists( 'kdMultipleFeaturedImages' ) ) { $args = array( 'id' => 'featured-image-2', 'post_type' => 'page', // Set this to post or page 'labels' => array( 'name' => 'Featured image 2', 'set' => 'Set featured image 2', 'remove' => 'Remove featured image 2', 'use' => 'Use as featured image 2', ) ); new kdMultipleFeaturedImages( $args ); }
page-template.php (where ” ’36’ ” references the post_id of the page I’m trying to display this featured image on):
<div class="img-wrap"> <?php if( class_exists( 'kdMultipleFeaturedImages' ) ) { kd_mfi_get_featured_image( 'featured-image-2', 'page', 'full', '36' ); } ?> </div>
https://www.ads-software.com/plugins/multiple-featured-images/
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Display featured images only on certain pages’ is closed to new replies.