0

In admin grid for post taxonomy, if I'll click on "Items" link, I'll get all post, associated with this taxonomy /wp-admin/edit.php?category_name=test. But this won't work for taxonomy for Custom Post Type. For example, /wp-admin/edit.php?cpt=test&post_type=cpt displaying 0 items.

1

The correct link should look like this:

/wp-admin/edit.php?{taxonomy_slug}={term_slug}&post_type={cpt_slug}

For example.
If you have taxonomy brand and it has term (category) test, your link will be:

/wp-admin/edit.php?brand=test&post_type=CPT
  • In my case, taxonomy name and CPT slug is equal, so links is the same with your. But result is empty. – user3013494 Jul 8 '20 at 17:05
  • Slugs should be unique. I bet you see an empty list because you are using the same slug for custom post type and taxonomy. This will also cause address collisions, e.g. /cpt/some-name/, may be a single CPT page or list of posts from the some-name term. – nmr Jul 8 '20 at 19:03
  • You're right. Now it's okay. Thanks! – user3013494 Jul 8 '20 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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