• I’m working on a site which is using Nextgen gallery. On some posts the content has a shortcode with a gallery ID. In other cases, the post contains an img tag:

    <img class="ngg_displayed_gallery mceItem" src="https://mysite.com/nextgen-attach_to_post/preview/id--8259" alt="" data-mce-placeholder="1" />

    Does anyone know how nextgen is retrieving the gallery ID when the post is displayed? I cant see a link from the posts table to the gid in the database.

    It looks like the following query may be relevant but extras_post_id is not always populated?

    SELECT DISTINCT wp_ngg_pictures.* , GROUP_CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS 'extras'
    FROM <code>wp_ngg_pictures</code>
    LEFT
    OUTER JOIN <code>wp_postmeta</code>
    ON <code>wp_postmeta</code>.<code>post_id</code> = <code>extras_post_id</code>
    WHERE (<code>exclude</code> = 0)
    AND (<code>galleryid</code> IN (311))
    GROUP BY wp_ngg_pictures.pid
    ORDER BY <code>sortorder</code> ASC
    LIMIT 500
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How does Nextgen Gallery retrieve the gallery ID from a post?’ is closed to new replies.