Multiple Featured Images
Doesn't work on pages. (4 posts)

  1. Astraldiva
    Posted 4 years ago #


    using your plugin and works great on posts. But something is not working on pages or maybe I am missing something.

    I use this code to add the support to pages and on page administration the box for image appears and I can add the image there.

    $background_page_args = array(
                    'id' => 'full-background-image',
                    'post_type' => 'page',      // Set this to post or page
                    'labels' => array(
                        'name'      => 'Full Background image',
                        'set'       => 'Set Full Background image',
                        'remove'    => 'Remove Full Background image',
                        'use'       => 'Use as Full Background image',

    But when I use this code to get the image in the page the function returns NULL.

    if( class_exists( 'kdMultipleFeaturedImages' ) ) {
    kd_mfi_the_featured_image( 'full-background-image', 'page', 'full' );

    Also I want to note that this function is used on page-about-me.php (template for specific page).

    Appreciate your help in advance.


  2. Nathan Parikh
    Posted 4 years ago #

    You are probably calling it outside of the loop, so it doesn't know which post ID to reference, so it's drawing a blank.
    This will most likely be your solution:

    global $wp_query;
    $thePostID = $wp_query->post->ID;
    if( kd_mfi_get_featured_image_url( 'full-background-image', 'page', 'full', $thePostID ) != "" ) {
        echo kd_mfi_get_featured_image_url( 'full-background-image', 'page', 'full', $thePostID );
  3. Andrew Tegenkamp
    Posted 3 years ago #

    Thanks Nathan, adding the parameter for the post ID works great in my application of this great plugin! I see it now at the bottom of the documentation, too :)

  4. Nathan Parikh
    Posted 3 years ago #

    Glad it helped, Andrew!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Multiple Featured Images
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.