How do I display a different group of photos with each blog post without uploading the photos to the Wordpress Media Library?
I’m using Wordpress for my blog. The blog is sort of a diary. One blog per day. The post title is each day’s date, in the format yyyymmdd. For each blog post, I take 10-50 photos. All the photos are in a single folder on my server. Each photo is numbered sequentially (1 thru whatever) & the file name of each image is the date (yyyymmdd) concatenated with the numeric counter.
I rather not upload all these photos into the Wordpress Media Library. (Or maybe I would upload just one photo per post.) When a visitor clicks on a link to view a post (of a particular day), I would like each photo to be displayed at the end of the post content. Either in a carousel or a grid.
I know that this is pretty straightforward if I would upload the photos into the WP Media Library, but that is what I’m trying to avoid.
I have at least 3 theories:
- figure out how to enter (programmatically) the image info to the media library. (Not sure if this can be done without triggering the photos being upload to the media library, which I don't want)
- do an add_filter on the_content (to insert the html needed),
- use a hook to capture output buffer & insert the html.