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 ) or use $wpb_all_query->setup_postdata()
to set the global variable $post
.
$wpb_all_query->the_post()
is equivalent to:
$wpb_all_query->next_post();
$wpb_all_query->setup_postdata();