Getting info about selected posts using one WP_Query
Change $wpb_all_query->prev_post() to $wpb_all_query->the_post(). Class WP_Query does not have prev_post() method, it has the next_post() method, which takes the next post from the results (set up post member of WP_Query object), but it does not set the global variable. To reach for the data of the current post, you must use $wpb_all_query->post (eg. $wpb_all_query->post->post_name ) … Read more