• Resolved rhysharris1994

    (@rhysharris1994)


    Hey team,

    On my Archive template ‘ve set up a Query Loop that inherits the template, so it should show whichever type of posts you’re viewing.

    Yet, no posts are showing up on the Tag page itself.

    Any ideas, please?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • bernhard-reiter

    (@bernhard-reiter)

    Hey,

    could you maybe share a screenshot of your Archive template while opened in the Site Editor please?

    As for inheriting the template — are you referring to the toggle in the sidebar for the Query Loop block? That is meant to make the Query Loop block inherit the query from the template (i.e. basically extract information from the URL on what kind of content to show). It doesn’t impact the visual representation of that content though. (To that end, you need to select a Post Template for your Query block, or build one yourself.)

    bernhard-reiter

    (@bernhard-reiter)

    Another thing that just occurred to me — do you currently have any posts tagged with the “abandoned-cart” tag? If not, that might explain why this page comes up empty. You could try tagging a few posts with that tag and see if it changes anything.

    Thread Starter rhysharris1994

    (@rhysharris1994)

    Hey Bernie,

    Thanks for responding. Strangely, this works for Page Categories, just not for Post Tags?

    Yes the tags are populated.

    https://snipboard.io/pKIFLO.jpg

    bernhard-reiter

    (@bernhard-reiter)

    Ah, I think I see what might be the problem. It seems like you’re using a Custom Post Type (CPT) called “sample” for the things that you’ve tagged with the “abandoned-cart” tag. However, the “Archive” template only applies to the built-in “Post” type (as do the “Tag” and “Category” templates).

    To verify that, can you please create a regular post and tag it as “abandoned-cart” and see if that shows up on on this page?

    Unfortunately, WordPress doesn’t currently have any way to create a template for an archive of a CPT with a given tag or category in the Site Editor. There are some possible workarounds:

    – Copy the content of the “Sample” CPTs into regular posts (or use a plugin such as Post Type Switcher).
    – If it’s enough to show an archive of all “Sample” CPTs (including the ones without the “abandoned-cart” tag), you can toggle the Query Loop block’s “Inherit query from template” and manually set the post type to “Sample” (see screenshot).

    Hope that helps!
    Bernie

    Thread Starter rhysharris1994

    (@rhysharris1994)

    Thanks Bernie, is the best solution to create a template for Sample archives?

    bernhard-reiter

    (@bernhard-reiter)

    In some ways, changing the Sample CPTs into regular posts will fit in a bit better with WordPress’ templating system, as it’ll allow you to use the Archive template without modification — and it will respect the “abandoned-cart” tag. (In this scenario, one way to convey that they are also “samples” would be to introduce a Sample category rather than using a Custom Post Type — would that work for you?)

    However, if you really want to retain them as Sample CPTs, then I can’t really think of another way other than modifying the Query Loop block. It does have the downside of ignoring the tag; in addition, the template will still “live” at that URL (tag/abandoned-cart/), which might make it extra-confusing. So overall, more downsides to this approach I’d say.

    Thread Starter rhysharris1994

    (@rhysharris1994)

    Thanks for your help Bernie, going to have a think and make a decision.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Posts not showing on Tag pages’ is closed to new replies.