Site logo

Archived topic

custom taxonomy for images

23 replies · Started by Ernst Wilhelm on October 14, 2022

Viewing posts 16–24 of 24

Perhaps I am wrong but generatepress hooking functionality does not provide access to custom taxonomies.

Have you created an archive template or a content template for the attachments ?
If you have not then it will use the themes index or archive.php - so the hooks should be there.

nope. Give me some time. I'll copy the archive.php to my child theme directory.

The hooks are there, I am thinking about the display rules. I want apply the modification only custom taxonomy archives, right??

Yeah you won't need to make your own custom archive.
You can add the condition to your PHP eg.


<?php
if (is_tax('attachment_category') {
    echo wp_get_attachment_image( $post->ID, 'thumbnail' );
}
?>

And the Hook Elements Display Rules you can then set to the Entire site.

Better but...

Let's call it a day. I'll come back to you in a few days.

Thank you so much for your input.

You're welcome - let us know how you get on

Hi.

Many thanks for your help here. For now I am closing this ticket. Other points are more interesting to me.

You're welcome

This archived topic is closed to new replies.