I’m trying to obtain a structure like this

1) Posts -> /%category%/articles/%postname%/
2) CPT   -> /%category%/CPT/%postname%/

But although I am able to see the right URL in the address bar, the page return a “404 error”.

Digging this down I noticed that the query that WP sends is not correct

SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_name = 'win' AND wp_posts.post_type = 'post'  ORDER BY wp_posts.post_date DESC

The post_type argument should be - in my case - qualifications as this is the name of the CPT.

Does anybody know how to fix this?
Is there any relationship with the add_permstruct function?


Read more here: Wrong post_type argument passed to the query when using a custom post type


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , , ,

Wordpress related questions and answers: