• Resolved zeckdude

    (@zeckdude)


    I can get the Secondary Image Upload box to show up in the admin area, but I can’t manage to get the image to display on the page.

    This is the code I am using to try and make it display (From: https://www.ads-software.com/extend/plugins/multiple-post-thumbnails/installation/):

    <?php if (class_exists('MultiPostThumbnails')
        && MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) :
            MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image'); endif; ?>

    I tried adding a random echo inside the if statement to see if it gets hit, but it doesn’t echo out, so i’m guessing somehow the condition is not being met?

    What am I missing?

Viewing 4 replies - 16 through 19 (of 19 total)
  • i’ve read a couple posts and i tried many various versions of codes. Here is what i have so far in my functions.php
    [Code moderated as per the Forum Rules. Please use the pastebin]

    and heres what i have in my page.php

    <?php if (class_exists('MultiPostThumbnails')
        && MultiPostThumbnails::has_post_thumbnail('page', 'image2')) :
        MultiPostThumbnails::the_post_thumbnail('page', 'image2', NULL, 'post-image2-thumbnail');
        endif; ?>
    
    <?php if (class_exists('MultiPostThumbnails')
        && MultiPostThumbnails::has_post_thumbnail('page', 'image3')) :
            MultiPostThumbnails::the_post_thumbnail('page', 'image3', NULL, 'post-image3-thumbnail');
    endif; ?>

    i’m new to wordpress and php. i spent many hours doing trial and errors but nothing worked and would love some guidance. thanks

    I have slightly different code for functions.php but the template (page.php) code looks similar. This is what I have in functions.php and it does work:

    https://pastebin.com/EqmXQR7i [Edited to use Pastebin – thanks mods]

    I have associated my thumbnails with a custom post type called ‘project’ but typically it would be page or post.

    Everyone starts somewhere – I’m still learning too!

    just tried to copy and paste that code and changed ‘project’ to ‘post’ and no luck. the picture will display in the editor, but when i refresh the site. theres no pictures there. i’m using this in conjunction with the wp-creativx theme. heres my old site, which sucks but is live now. https://themagiclaundry.com and the new site that i’m trying to put up is https://themagiclaundry.com/blog if you notice the 3 picture thats on there now are from 3 separate empty posts with just the “featured” custom field filled out.

    https://pastebin.com/FXmFpHmQ

    This is what I have in single.php, but I note that you’re using ‘post’ on the functions.php one but ‘page’ in the template part?

    Very nice looking site btw ??

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘[Plugin: Multiple Post Thumbnails] Image not displaying’ is closed to new replies.