Find all images with a certain tag in the media library using the visual portfolio plugin

Find all images with a certain tag in the media library using the visual portfolio plugin

Introduction:

I am developing a WordPress website and want to use the Visual Portfolio plugin (https://wordpress.org/plugins/visual-portfolio/). This plugin gives me the ability to display a gallery of posts. It also gives me the ability to query my messages with a custom one question string:

What I want to do:

I want the visual portfolio plugin to search all images in my media library with the category gallery.

What I did:

I used the F4 Media Taxonomies plugin (https://wordpress.org/plugins/f4-media-taxonomies/) to give categories to my images. Following that plugin’s directions, I added the following code to my functions.php to make the taxonomy possible category:

add_action('init', function() {
    register_taxonomy_for_object_type('category', 'attachment');
});

Then on the page where I create my Visual Portfolio gallery (screenshot above), I add the following query string:

post_type=attachment&post_mime_type=image&post_status=inherit&tax_query[0]taxonomy=category&tax_query[1]term=gallery&tax_query[2]field=slug

What happens:

The Visual Portfolio plugin easily displays all images in my media library, not just images with category gallery.

Any ideas? Thank you

#Find #images #tag #media #library #visual #portfolio #plugin

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *