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();
Related Posts:
- Inject post (from specific category) between posts in Loop
- Count number of published posts by type
- Get taxonomy terms only of the WP_Query current posts
- Hide post if matches current month and year
- How can I use wp_query to show all product data using just the products ID?
- How to store post ID’s in cookie or session to display the same posts later
- WP_Query: getting posts where custom field exists
- Array to string conversion on array_map
- Store metakey value as an array
- Increment paged on WP_Query
- Modify main query before it run without pre_get_post
- Do not duplicate posts with multiple categories in multiple loops
- array_rand not working correctly?
- WP_Query() load selected post
- Wp Query : Order by distance lat,lon
- WordPress sorting posts by date and title using a dropdown
- posts_per_page displays only 2 posts instead of 4 posts
- Query on a repeater date (acf)
- Need to show 7 posts from actual date
- Check the database for a postmeta field
- How to display last whole post on the homepage
- Only Get A Certain Number of Posts From WP_Query
- insert thumbnail image from php script
- Weird Behaviour: Not all WordPress Posts appearing
- List of child pages fetch next results at link click
- Query category-specific, paginated posts and allow viewer to change sort order
- Why does WP_Query show only the same post even with different categories and endwhile?
- How to modify this function to exclude also the post belonging to a specific category?
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Insert code when users come from an specific referer
- How to display related posts from parent category
- Duplicates with WP_Query loop
- Make custom field meta not display if there is not data in it
- Display related products with custom output
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- Use wp_get_recent_posts with search term
- have_posts() execution failure
- Can’t search posts using WP_QUERY inside AJAX Function
- How to query for posts with a null or blank post_name?
- WordPress pagination not working with search page
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Loop through categories and display posts title under each dropdown
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- auto-populating custom nav with all items from custom post type
- List authors with the last post title and order by last post date
- How to get all author posts outside of author templates
- How to get post ID in a Page?
- Automatically add images to a menu
- How to override url params with rewrite rules vars?
- How to display SQL query that ran in WC_Order_Query?
- Only show first image in foreach loop
- Post not populating for custom post type based on category selection
- create front-end users post list by specific category
- Infinite Loop – WP_Query
- show recent posts php code error?
- Error display post thumbnails for previous and next post
- Post to WordPress from another Server via PHP
- Wrap posts p tags in div
- WordPress SQL JOIN query
- WP_Query and help with the loop for magazine front page
- How to WP_Query posts order by parent title?
- search.php to search only the post title
- WP_Query – How to query all of post types categories
- How to work Woocommerce pagination inside shortcode?
- Generating 10 000 WordPress posts using PHP and avoiding Server Timeout error
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- Filter wordpress posts without searching the keywords in the post content
- get different meta-data of a complicated query at the same time
- wp_Query with mutuplea values returns all posts
- Use WPQuery to match to specific repeater row in post
- WP_QUERY post_in problem
- How to get post titles by post ID and integrate with my code?
- how to get data from two different table from wordpress database
- Assign meta_query value to php variable
- Infinite looping next post link within a certain category on a post
- Wp-query output correct, but the loop shows one less item (only sometimes)
- Get list of posts from attachment
- How to display sticky post always at the top (before regular post) in wordpress?
- When working with a post, almost all wp_postmeta are deleted
- How to get the posts that my following users are liked?
- Displaying POST content with HTML tags and all
- Pagination in WP Queries
- Add div after every 4 posts then every 2 posts for a responsive loop
- direct query to post_meta table
- Can’t put a hyperlink on Featured Post’s Image
- WordPress get_post_meta issue
- List sibling pages widget, exclude current page
- Display pages from specific page template
- Does wp_query and query_posts affect website performance? [duplicate]
- WordPress post pagination on custom template not working
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- How to display the date under the post title?
- Changing regular db connection to $wpdb
- XML WP_Query problem in PHP 8.0 and 8.1
- How do I display WooCommerce products in my query to rows of 3?
- How to get ACF field to show up on all posts on front end?
- AND and OR in my CPT search query depending on checkbox
- How can I save the HTML output of a WP_Query function as a variable?
- How do I use fields => ids in an array with WP Query?