Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Multiple Post Thumbnails WP plugin

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #35417
    tobeeornot
    Member

    Has anyone used this plugin? I have installed and registered it for multiple images but I am not getting a response in the template I am applying to and would appreciate some assistance.

    #91675
    TheDoc
    Member

    Haven’t used it, sorry!

    #91677
    tobeeornot
    Member

    Hey Doc, basically I just want a way for the user to upload three images via the WP back-end page and apply one class for padding, etc. Is there another way around it?

    #91678
    TheDoc
    Member

    Well, I’m slightly confused as to what you want to do! Previously, it looked like you were pulling in three separate pages onto the home page – is that still the case?

    If so, you can just attach a featured image to each of those pages.

    #91680
    tobeeornot
    Member

    No, I just want to pull three images onto the home page. The images don’t come from any other page but need to be uploaded by the user to the homepage. Therefore I don’t think I can use the Featured Image to do it as it only applies to one image, no?

    #91682
    TheDoc
    Member

    You are correct.

    You can pull attachments from a page (so, if a user has uploaded three images onto a page you can pull them out) but they’d all have to be the same dimensions and the order in which they are uploaded would matter – not a very good solution!

    Do you have a screenshot of what you’re trying to accomplish? I think I have an idea of something that you can use.

    #91683
    tobeeornot
    Member

    Screenshot

    So you can see, it is just three separate images. I just want to give the user the ability to change them via the back-end in the easiest way. It would good so they good adjust the dimensions but not essential.

    #91685
    TheDoc
    Member

    You could use the Advanced Custom Fields plugin here. Each title, text, link and image would be a separate field. So in total you’d have… 12 fields that are editable. Maybe not the nicest solution, but it’d certainly be the most flexible.

    #91687
    tobeeornot
    Member

    Would you use that? Or were thinking of something else?

    #91689
    TheDoc
    Member

    I think that’s probably the way I’d go. Either that or create three subpages under home and pull the content from each of those in.

    #91690
    tobeeornot
    Member

    Cheers Doc.

    #91699
    noahgelman
    Participant

    I’ve used this plugin several times and know it well. Paste in the code you’re trying to use and I’ll tell you how to edit it to fix your issue

    #91738
    tobeeornot
    Member

    @noahgelman

    Thanks for that – I appreciate it.

    The problem seems to be that when I go to upload the images from the WP back-end, there is no options for selecting multiple images, but it does specify the option to select image dimensions i set.

    Functions php:


    // Add secondary thumbnail (featured image) in posts */
    if (class_exists('MultiPostThumbnails')) {
    new MultiPostThumbnails(array (
    'label' => 'Secondary Image',
    'id' => 'secondary-image',
    'post_type' => 'post' )
    );
    new MultiPostThumbnails(array(
    'label' => 'Quaternary Image',
    'id' => 'quaternary-image', )
    );
    new MultiPostThumbnails(array(
    'label' => 'Tertiary Image',
    'id' => 'tertiary-image', )
    );
    }
    add_image_size('post-secondary-image-thumbnail', 176, 58, true);
    add_image_size('post-tertiary-image-thumbnail', 176, 58, true);
    add_image_size('post-quaternary-image-thumbnail', 176, 58, true);


    I am looking to add three images on this template. This is the template for the relevant page:





    What We Do





      query_posts("posts_per_page=1&post_type=page&page_id=168");
      the_post (); ?>



    • MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL, 'post-secondary-image-thumbnail');
      ?>
      " class="button">View More


    • the_post(); ?>



    • MultiPostThumbnails::the_post_thumbnail('post', 'quaternary-image', NULL,
      'post-quaternary-image-thumbnail');?>
      " class="button">View More






    • 'post-tertiary-image-thumbnail');?>
      " class="button">View More









    #91796
    jeleyinte
    Member

    I have used once ‘cos I didn’t like the layout, so I uninstalled it.

    #91919
    noahgelman
    Participant

    Yeah, your code is a bit different than mine. Here is an example of mine.

    Functions.php


    if (class_exists('MultiPostThumbnails')) { new MultiPostThumbnails(array( 'label' => 'Second Featured Image', 'id' => 'second-image', 'post_type' => 'post' ) ); }

    Page code:

    
    if (class_exists('MultiPostThumbnails')
    && MultiPostThumbnails::has_post_thumbnail('post', 'second-image')) :
    MultiPostThumbnails::the_post_thumbnail('post', 'second-image', NULL, 'blog-post-thumbnail');
    endif;
    ?>

    Compare them and see the differences with yours

Viewing 15 posts - 1 through 15 (of 15 total)
  • The forum ‘Other’ is closed to new topics and replies.