• Can anyone suggest how i can extract from PHPMyadmin a list of all the URL’s that are the featured images of all the galleries.

    We have over 3000 galleries and need to get this featured image list and I cannot work out quite where all the information is stored about the images and the gallery itself in the WP Tables.

    Many thanks

    Steve

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

    (@bradvin)

    Hi Steve,

    Under the hood, a FooGallery gallery will use the standard featured image functionality built into WP. If no featured image is set (via the Featured image metabox) then the first attachment in the gallery will be considered your featured image.

    So, to make your life easier, I hope you have set featured images for your galleries using the standard metabox.

    In WP, featured images are linked to any post (or custom post type) using post meta with the key ‘_thumbnail_id’, and this will be the same for the foogallery custom post type.

    If you have not set Featured images in the standard way, then you will have to query the first attachment.

    In Foogallery the attachments are stored in a comma separated list as post meta for the foogallery custom post type. The post meta key is ‘foogallery_attachments’. An example of what this will look like is ‘12,15,120’ and refers to media attachments stored in the database with ID’s 12,15 and 120.
    In this instance if no featured attachment was set for the gallery, then the attachment with ID of 12 would be considered the featured image.

    I hope that info helps you solve your problem.

    Another solution would be to write some PHP code that loops through all galleries and echo’s the featured attachment. You could use the foogallery_get_all_galleries function

    Plugin Author bradvin

    (@bradvin)

    This link might also help from a SQL query point of view : https://wordpress.stackexchange.com/questions/48878/get-featured-image-via-direct-sql-query

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Featured Image’ is closed to new replies.