Site logo

Archived topic

Posts not showing on Tag archive

11 replies · Started by David on December 7, 2022

Viewing posts 1–12 of 12

Hi there,

in the query Loop settings you will see an Option to: Inherit Query from Template - enable that.

Can you uncheck that option.
Remove any of the other paramters that were added.
And then re-enable that option.

No luck with that. I've provided credentials. It's in elements > Block : Projects Archive Tag

Can you take a look and see what I'm doing wrong.

Hi David,

Can we see the original tag archive without this element being activated?
Just want to make sure there're posts in this tag archive.

Let me know!

Are those Tags being used the core Tags ie. for Posts ?

I think so, is it possible to separate them out? Do I need to set up a specific taxonomy that sits in posts?

Try this PHP Snippet to include your CPT in those tag archives:


function db_custom_post_type_for_tags_archive( $query ) {
    if ( $query->is_main_query() && ! is_admin() && ( is_tag() && empty( $query->query_vars['suppress_filters'] ) ) ) {
        $query->set( 'post_type', array( 'post', 'your_post_type_slug' ) );
    }
}
add_action( 'pre_get_posts', 'db_custom_post_type_for_tags_archive' );

Change the your_post_type_slug accordingly.

Glad to hear that !

This archived topic is closed to new replies.