0

The CPT has been registered fine, with the name 'qna' and slug 'advice'.

Viewing domain.com/advice correctly displays the archive-qna.php template.

Viewing domain.com/advice/custom-post-title also works correctly and displays using single-qna.php.

The problem comes when adding these custom posts to the standard post categories.

In that instance when viewing domain.com/advice/category results in a 404.

I think I may of found a work around, creating a qna post that matches each of the standard categories we're using, then using a conditional within single-qna.php.

However is there another way to solve this?

1
  • How did you got the link domain.com/advice/category ? It an invalid link. A category page link does not follow post type slug, they follow their own slug. Slug for the default Taxonomy category is category. So, by default the link should be domain.com/category/category_name.
    – Shazzad
    Commented Feb 26, 2014 at 16:29

1 Answer 1

0

They will be available at:

 domain.com/category/your-category/

This means that if view this URL you might also see posts (the built in WordPress ones) in there too as they too can have categories.

If you don't want these 'qna' posts to be mixed in with the default posts then you should create a taxonomy and use that: i.e. advice-categories

Your advice posts will then be available at:

 domain.com/advice-categories/your-advice-category/

You can specify your own slug too just like Custom post Types.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.