• Resolved delanthear

    (@delanthear)


    I’ve created two Custom Post types. Bands (band) and Clubs (club). Both have Enable Archive Page set and identical settings. Both have autotemplates enabled, and each are set with their own singular template (club and band) and list template (‘club archive’ and ‘band archive’).

    Both list templates are identical with the exception that the club template has:

    [if club]
            [each club]

    at the start of the template so it displays the template for each entry and the band template has:

    [if band]
            [each band]

    If you go to https://thegothcalendar.co.uk/bands/ you correctly get the list of bands set up in the bands custom post type.

    If you go to https://thegothcalendar.co.uk/clubs/ you get bands instead of clubs.

    I have no idea why or how to debug!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @delanthear

    Please share your Pod and field settings an a bigger part of the template.
    It might be that there are some overlapping names here.

    Cheers, Jory

    Thread Starter delanthear

    (@delanthear)

    Thanks. I was chatting to someone about this on the Slack, but we didn’t really get to the bottom of it completely. It might be plugin clashes.

    If you go to /bands, you get an archive page using the list auto template. If you go to /clubs, you also get an archive page using the list auto template, but it’s pulling data for the bands post type, not clubs.

    It seems to be working now if you go to /band or /club (singular) once I’d resolved a problem with the events calendar overriding the club slug, but this version of the template includes a title I don’t want. I could write a new template to overcome this but the one that is appearing on /bands is perfect, apart from it returning the wrong data on /clubs. Also, it’s annoying that I can’t work out what’s happening ??

    https://thegothcalendar.co.uk/wp-content/uploads/pods-package-2022-02-12.json

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @delanthear

    If I check both pages on your live site instance I see in the body classes that both are an actual page in your WP installation?
    This gives me the impression that you are using third party plugins to support this since CPT archives are normally not pages in WP.

    Also, both pages are using the “band archive template”.

    I get the feeling that you have some plugins installed that er conflicting with each other in the current state.
    You might want to try to disable them all and enabling them one by one to find the problematic plugin.
    Also verify all of your slugs for correctness and make sure you aren’t using them in several locations.

    Cheers, Jory

    Thread Starter delanthear

    (@delanthear)

    Oh! I created a band archive page a while ago which I’d duplicated for clubs but then deleted. It was cached out still and wasn’t clearing when I hit the clear button. Removed them from the filesystem and it’s now working!

    Thanks for the hint there!

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @delanthear

    Glad that worked, good luck on your project!

    Cheers, Jory

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘autotemplate returning wrong results?’ is closed to new replies.