WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
Exclude the thumbnail from gallery (6 posts)

  1. lorembolo
    Member
    Posted 1 year ago #

    Hi !
    I'm using this plugin for a gallery portfolio I'm working on.

    I use the regular thumbnail on this page wich shows a list of artists:
    http://www.artistigalerie.fr/les-artistes/

    Then, I use a second thumbnail on the artist's portfolio
    (ex : http://www.artistigalerie.fr/artiste/francoise-calcagno/)

    As you can see, the second thumbnail appears in the content if I use the gallery feature.

    Does anyone knows how I could avoid this ?

    Thanks in advance.

    http://wordpress.org/extend/plugins/multiple-post-thumbnails/

  2. Chris Scott
    Member
    Plugin Author

    Posted 1 year ago #

    You can use the 'exclude' attribute of the gallery shortcode and pass in the id of the second thumbnail. e.g. [gallery exclude=22] to exclude the image with id 22. Not very flexible but it is easy and doesn't require any development.

  3. lorembolo
    Member
    Posted 1 year ago #

    It's right, it works.
    The problem is that the final client will not be able to do this for sure.

    I can also use the :last CSS propertie and tell the client to put the thumbnail at the end of the gallery.

    Allow to exclude the multiple thumbnail of the content attachments could be an usefull feature, don't you think ?

    Anyway, thanks for answering.
    :)

  4. Chris Scott
    Member
    Plugin Author

    Posted 1 year ago #

    The only somewhat clean way I can see to do this in code is to filter post_gallery but that would mean duplicating all of the gallery shortcode output code and having the calls to get_children() pass in the exclude id.

  5. lorembolo
    Member
    Posted 1 year ago #

    wow..it dos not seems easy for a beginner like me !
    ;)

    Well, for this particular project, the best way is to invert the use of thumbnails. This way, the 2nd thumbnail for an artist, wich is a painting, can be included in the gallery. And the regular Thumbnail can be used to display the pic of the artist.
    (does it make sense?)

    Many thanks for your work, it helped me.

  6. rightmost
    Member
    Posted 1 year ago #

    Hello, I would also love to be able to exclude the extra thumbnail from a gallery. The client will not be able to add the gallery shortcode themselves, so 'exclude=22' won't work.

    What I have done is place this in the template:

    <?php  $thumbnail_id = get_post_thumbnail_id(get_the_ID()); ?>
    <?php echo do_shortcode('[gallery exclude='.$thumbnail_id.']'); ?>

    This removes the regular thumbnail, but not my secondary thumbnail. Any ideas?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic