D
D
denism3002020-02-26 22:45:22
WordPress
denism300, 2020-02-26 22:45:22

Which Wordpress plugin can group images and display them?

Tell me a plugin that can group images by specified categories and display a list of images by category in an array:

<img src="1.jpg" />
<img src="2.jpg" />
...
<img src="10.jpg" />

those. without any effects, galleries and other things - a stupid list of pictures in a category for further processing. Shortcode or request in the code - it doesn't matter.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
denism300, 2020-02-27
@denism300

In general, I solved the problem like this:
Installed the Enhanced Media Library plugin, created a taxonomy in it, then created categories in this taxonomy, sorted out the pictures, and already in the template code I pull out the necessary pictures with a request

$posts = get_posts(
    array(
        'post_type' => 'attachment',
        'tax_query' => array(
            array(
                'taxonomy' => 'mediacat', //такса
                'field' => 'slug', //поле, по которому ищем
                'terms' => 'reviews' //слаг рубрики внутри таксы, из которой вытаскиваем картинки
            ),
        ),
    )
);
foreach ($posts as $p) {
    echo '<pre>' . print_r(wp_get_attachment_image_url($p->ID, 'full'), 1) . '</pre>';
}

in principle, if you only need the full size of the image, then instead of wp_get_attachment_image_url(), you can access the guid property:
echo '<pre>' . print_r($p->guid, 1) . '</pre>';

L
Lord_Dantes, 2020-02-26
@Lord_Dantes

This is a very specific plugin. All this needs to be written in code.

V
Vladik Bubin, 2020-02-27
@ikoit

There is no such plugin, but you can write it yourself. Or you can add classes to pictures and you can drive these pictures using php or js code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question