• Dear all,
    In my WP installation, I want to show a gallery of images, which is based not on a static media content I provide forehead as it is foreseen by WP, but on a dynamic SELECT SQL command originating from a search form the user submits. Is there already a (free) plugin which interfaces a (standard WP or another) gallery with a custom SELECT SQL command? If not, where can I find the piece of code in WP which selects the images to show in a gallery from the WP media content so that I can replace it with a custom one. Thanks a lot.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Can you explain why you need to use a custom select statement to display a gallery of images that are being stored in the WP Media Library instead of just using filters in WordPress or a plugin?
    Or, give a better detailed example of this part:
    > originating from a search form the user submits

    You mean – if a user searches for Cats – you want all the Cats to display in your results? You can use EXIF, but I think most people would use Tags / Categories so the visitor can filter the results using search facets.

    Thread Starter Stefi

    (@stefsoton)

    Hi Corrina,

    First of all, I’m not sure, I want to store my images in the WP media library; I might decide to store these elsewhere on the server, but mainly because I want to use search criteria for the image in a custom table that WP does not cover. For example: subject, sub-subject, location, time/date and so on.
    The WP installation works as a search page where the user enter keywords or categories of images he/she wants to see and after a submit the search results are shown up as a gallery of images.
    Your example of the cats (mine not about animals, but it’s a good example) is what I meant, with the difference that O use more than one search criteria: not only the species but also the race, the location, the owner, the time and more (let’s say).
    Last but not least:
    >> I think most people would use Tags / Categories so the visitor can filter the results using search facets.

    Uhm? In WP, can you show a gallery of images based on one of more categories or on one or more tags?
    Cheers

    Understood. I guess it depends on your expectations of working re: scale, maintenance, etc within the WordPress framework.

    > can you show a gallery of images based on one of more categories or on one or more tags?

    Sure.
    Not natively, however – something like this allows you to use IN in your query:
    https://facetwp.com/how-to-filter-wp-attachments/
    https://facetwp.com/

    or,
    https://fatstacksblog.com/filtered-search-image-galleries/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP Gallery of images based on a SELECT custom SQL comment’ is closed to new replies.