• Resolved fredhead

    (@fredhead)


    I’ve got everything working with three custom content types except the archive list pages and category list pages. I don’t want to use plugins (tried them, too much complexity, not enough control, insufficient results, conflicts with other plugins). If people can point me to solutions and ideas, I’d be grateful.

    Using one content type as an example, here is my register function:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I’ve created an FAQ template and assigned it to a page called FAQs (so the URL is /faqs, as in the rewrite value above, in the register function):

    [Code moderated as per the Forum Rules. Please use the pastebin]

    First problem: when I call up mysite.com/faqs I get an initial page load of 2 items with an “Older Posts” link. When I click the Older Posts link, however, I get a 404 for /faqs/page/2/ URL.

    Second problem: on the mysite.com/faqs page, when I click a category link included in an entry, I get the default Hello World post, not my custom type FAQs entries. I’m using the default WordPress category taxonomy, not custom taxonomies (not needed, in this case).

    When I created an archive-faq.php page, I still got the 404. So I switched to the older method of using and assigning a template.

    Any ideas how to get the /page/2/ URL working with my template, or how to get archive-faq.php to be recognized by WordPress, would be appreciated. Same for getting the categories to display (which are not custom taxonomies).

    Thank you!

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter fredhead

    (@fredhead)

    Exactly. My hunch is that the default permalinks needs the post_type to be the same as the name registered for the content type. When you use non-default permalinks, that’s when you can use rewrite.

    BTW pagination didn’t work straight off so I’ll work on that today and come back if I absolutely can’t figure it out. I appreciate your help!

    Moderator keesiemeijer

    (@keesiemeijer)

    default permalinks needs the post_type to be the same as the name registered for the content type

    Yes, it doesn’t use the rewrite slug when the default structure is set.

    Thread Starter fredhead

    (@fredhead)

    Hi,

    If you’ve not seen, I’ve posted my pagination question as a separate topic here:

    https://www.ads-software.com/support/topic/problems-with-custom-content-type-pagination

    I’ve wasted most of today working through the topic link you posted earlier, trying a vast array of solutions, to no avail. Any ideas would be appreciated if you have time/interest. Thanks.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Custom Post Type Archive Page Issues’ is closed to new replies.