Site logo

[Resolved] Posts not showing on Tag archive

Home Forums Support [Resolved] Posts not showing on Tag archive

Home Forums Support Posts not showing on Tag archive

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2452624
    David

    Hello

    I’ve set up a query loop and set it to show on tag archive, but archive pages are showing up blank…
    https://www.hatfieldinteriors.com/tag/ffe/

    Please see image attached – any ideas why nothing is showing?

    https://ibb.co/B6JcGR3

    Thanks
    Dave

    #2452772
    David
    Staff
    Customer Support

    Hi there,

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

    #2452781
    David

    I’ve done that but it’s still shows up blank…
    https://www.hatfieldinteriors.com/tag/ffe/

    #2452814
    David
    Staff
    Customer Support

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

    #2452822
    David

    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.

    #2453527
    Ying
    Staff
    Customer Support

    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!

    #2454198
    David

    Hi Ying, I’ve done that, nothing found…
    https://www.hatfieldinteriors.com/tag/ffe/

    #2454330
    David
    Staff
    Customer Support

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

    #2454332
    David

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

    #2454588
    David
    Staff
    Customer Support

    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.

    #2454802
    David

    I’ve ended up setting a taxonomy called categories and assigned it to Projects and that’s working…

    https://www.hatfieldinteriors.com/categories/colleges/

    #2454827
    David
    Staff
    Customer Support

    Glad to hear that !

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.