• Resolved mrengy

    (@mrengy)


    I have a WP_Query that is pulling thumbnails and links to attachment posts. It works with images, but I’m having a hard time getting it to show thumbnail images on videos, using the videopack shortcode.

    Here’s the relevant bit of code. I tried a few ways of doing it (below):

    do_shortcode('[videopack gallery="true" gallery_include="'.$this_id.'"][/videopack]');
    $thumbnails[] = do_shortcode('[videopack gallery="true" id="1021"]');
    $thumbnails[] = do_shortcode('[videopack gallery="true" id="'.$this_id.'"]');
    $thumbnails[] = do_shortcode('[videopack gallery="true"][/videopack]');
    $thumbnails[] = do_shortcode('[videopack gallery="true" ids="'.$this_id.'"][/videopack]');
    $thumbnails[] = do_shortcode('[videopack gallery="true" include="'.$this_id.'"]');
     

    (by the way, I verified that $this_id was set correctly) but they all gave me empty divs like:

    <div class="kgvid_gallerywrapper kgvid_textalign_left" id="kgvid_gallery_0" data-query_atts="{&quot;gallery_orderby&quot;:&quot;menu_order ID&quot;,&quot;gallery_order&quot;:&quot;ASC&quot;,&quot;gallery_id&quot;:1,&quot;gallery_include&quot;:&quot;&quot;,&quot;gallery_exclude&quot;:&quot;&quot;,&quot;gallery_thumb&quot;:&quot;250&quot;,&quot;gallery_thumb_aspect&quot;:&quot;true&quot;,&quot;view_count&quot;:&quot;false&quot;,&quot;gallery_end&quot;:&quot;&quot;,&quot;gallery_per_page&quot;:&quot;&quot;,&quot;gallery_title&quot;:&quot;true&quot;}"></div>

    I did generate thumbnails using videopack. Also tried toggling the plugin setting of “attach thumbnails to” (tried post and video) and clicking “set all parents”, but that did not change things.

    See demo on my dev site at https://historyscv-dev.dreamhosters.com/media/?vhs_year=1992&ensemble=vanguard – use the username: guest / password: guest to view it. Also here’s a single video attachment page whose thumbnail should be included in the earlier link but isn’t showing.

    This doesn’t have to use the [videopack gallery=”true”] shortcode – ultimately I first just want to get thumbnail images for video posts inside The Loop, and I can do the rest of the things other ways.

    Also, is there supposed to be more documentation on https://www.videopack.video/ ? the “docs” link in the main nav just directs to the homepage where there are only a couple of basic examples.

    • This topic was modified 1 year, 8 months ago by mrengy. Reason: clarified goal
    • This topic was modified 1 year, 8 months ago by mrengy. Reason: added single attachment

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    Sorry, there’s something going wrong with the BetterDocs plugin on videopack.video. I’m working on fixing it.

    I’m not totally sure why the video gallery is empty but if I understand it correctly you only need to get the thumbnail associated with the video? A video gallery would make a pop-up video window when you clicked on it and I wouldn’t recommend using it just to get a thumbnail image.

    Usually Videopack will set the attachment’s post thumbnail value so you could use get_the_post_thumbnail_url( $this_id, 'thumbnail' ) or related functions like get_post_thumbnail_id if you need different information about it. You can also try get_post_meta( $this_id, '_kgflashmediaplayer-poster', true ) to get the full-size video thumbnail url or get_post_meta( $this_id, '_kgflashmediaplayer-poster-id', true ) to get the id of the thumbnail.

    Thread Starter mrengy

    (@mrengy)

    Thanks! get_the_post_thumbnail_url( $this_id, 'thumbnail' ); worked out for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unable to display thumbnails in a gallery’ is closed to new replies.