Show current user posts in custom post type query
There are 2 fundamental problems here: Problem 1 pre_get_posts lets you modify a query before it happens, and in this case you’re modifying the main query before it happens. But you do this: if ( get_post_type() == ‘saved-orders’ ) { get_post_type shouldn’t work here as it’s too early, the main query hasn’t happened yet. Instead, … Read more