• damienlee

    (@damienlee)


    Hi Folk! I have a site with multiple custom post types created with ACF.

    When I load a custom post type archive it correctly shows the page title, as set with SEO framework.

    HOWEVER, when I filter that archive as follows, it shows the plural label for the first custom post type I setup with ACF, regardless of which custom post type archive im on. It ignores the version setup with SEO Framework. It would be fine to use the plural label setup in ACF, but it shows the plural label of the first custom post type I setup on all others.

    Example: domain.com/custom-post-type/?taxonomy=one

    This happens with all custom post types and always defaults to the first custom post type I setup with ACF. The only thing that fixes this issue is to disable SEO framework at which time all custom post types use their assigned plural labels.

    Thoughts?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Damien,

    There appears to be a query happening on your site that isn’t registered with WordPress. Because this goes outside of the standard WordPress APIs, TSF won’t know what to do with it.

    If on the ?taxonomy=one-query, hundreds of filters are registered to somewhat glue WordPress together, then TSF might also be affected because it reacts to some of those filters via standard WordPress functions.

    If you could share the URL of the page affected, then I can verify this.

    The workaround would be to make the original, unfiltered Custom Post Type Archive the ‘canonical’ one when using the ?taxonomy= queries; i.e., remove some filters that are invoked by that query. Even better would be to register the queried pages as actual taxonomy terms via https://developer.www.ads-software.com/reference/functions/register_taxonomy/. I don’t know if ACF can do this for you.

    Thread Starter damienlee

    (@damienlee)

    Thanks for your response. I don’t think this is the problem. If i disable TSF the page titles show correctly as generated by wordpress without issue. Also, the post-type unfiltered is already the canonical.

    Let me clarify with another example:

    Post-types: Authors, Books, Publishers
    Taxonomy: Genre

    In this example, Authors is the first listed post-type created with ACF.

    domain.com/authors/ (page title Authors | domain.com)
    domain.com/authors/genre/fiction/ (page title Authors | domain.com)

    domain.com/books/ (page title Books | domain.com)
    domain.com/books/genre/fiction/ (page title Authors | domain.com) <– Should be “Books”

    domain.com/Publishers/ (page title Publishers | domain.com)
    domain.com/Publishers/genre/fiction/ (page title Authors | domain.com) <– Should be “Publishers”

    There are not multiple filters involved, simply one common taxonomy filter. Its as though TSF is mapping to the taxonomy over the post-type and attributing the taxonomy to the first post-type its attached to and returning the page title for that post-type instead of the post-type the archive is actually for. Im starting to think its actually a bug with TSF. That TSF assumes a taxonomy will only be attached to a single post-type and grabs the title this way.

    I appreciate your help!

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi again!

    Many plugin authors that implement post types incorrectly remedy WordPress’s behavior in a way that appears to work correctly, but these fixes escape plugins like The SEO Framework.

    However, something else may be at play since we’re dealing with a custom post type created via ACF. Still, they’ve only recently added the feature to create custom post types (I wasn’t aware of this before), so something might need to be ironed out.

    Could you help me replicate your CPT? At “ACF > Tools > Export,” you can select the post type and hit “Export As JSON.” Put that JSON file into a ZIP (or upload it to Pastebin or GitHub Gists), and you can send it to me confidentially here: https://tsf.fyi/contact. Thanks!

    P.S. A URL to the pages affected would still be helpful.

    Thread Starter damienlee

    (@damienlee)

    Hi Sybre

    Its entirely possible this issue could be caused by something different with ACF registering of post-types and taxonomies. I didnt have this issue when I used Pods to do this task but trusted ACF should be a good option to avoid needing to use pods anymore.

    Do you want all post-types and taxonomies?

    For reference, all have the api enabled for each type with ACF.

    I should also mention that I use Oxygen Builder, but the only difference between when I didnt have an issue and now has been a much later TSF version and using ACF to register the posts-types and taxonomies. I assume its an TSF issue mainly because without it they display correctly. Also the fact that TSF doesnt use the custom title and descriptions I set for my post-types is cause for concern

    Plugin Author Sybre Waaijer

    (@cybr)

    Howdy!

    Yes, the taxonomies would also be helpful in testing this.

    Thread Starter damienlee

    (@damienlee)

    Thanks Sybre! Sent as requested ??

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Damien, I received it! ??

    Please allow some time for my follow-up because I need to free up my schedule. I’ll keep you posted!

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Damien,

    I just tested the PTA from ACF. I do see your expected title on my site.

    If you go to “WP Admin > SEO > Post Type Archive Settings > Select archive to edit:” and select the PTA like “Compare” or “Best Rated” (or anything else), you can edit the meta titles there.

    Perhaps you have already filled something in. Whatever is in the “Meta Title” should be reflected on the front end. Does changing or clearing this title resolve the issue?

    Thread Starter damienlee

    (@damienlee)

    Hi Sybre

    I replied but for some reason it didnt update here so I will paste in my response below:

    No, no TSF title or meta are passed to this template at all even though they are set and have worked for me prior to this version using ACF registered taxonomies and post types. That doesn’t mean that’s the cause though but just a consideration.

    It’s as though TSF is not hooking into the page at all. Is there a built-in function I can call on the page to log what TSF is doing if anything?

    I should qualify that, if the archive is unfiltered by a taxonomy it does show the correct title and meta in the page. Its just when its filtered that they all revert to the one post type title regardless of which post type is being viewed.

    Cheers Damien

    PS…Just been messing with hreflang tags and occured to me that it would be useful as a feature to add this to the sitemap via TSF as a possible future feature option.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Damien,

    I replied to your email and requested a list of active plugins. I hope it reaches you well.

    I appreciate your patience, by the way! I’ve been working on my office network and some other tasks, and nothing went according to plan ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Filtered CPT archives have the incorrect title’ is closed to new replies.