You should use posts_per_page=4 instead of showposts=4.
Reference: WP_Query Pagination Parameters
Related Posts:
- Use wp_get_recent_posts with search term
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- How do I use WP_query with multiple post IDs?
- Best Practice for PHP
- Include WP_Query in my own PHP file?
- Inject post (from specific category) between posts in Loop
- is_page() not working from within a plugin
- Passing JSON data from WP Query into AJAX causing NULL errors
- AJAX / Read More: multiple check_ajax_referer() and wp_create_nonce() not working independentely
- Display certain amount of posts on taxonomy archive page
- Result of Custom WP_Query appears on 404 Page (but result are found!)
- Show only one post for each author ( Page loads too slow )
- How to add 2 posts under another post? Formatting should be intact
- Get list of WP Updates Across Sites
- what is diference wp_get_attachment_url / wp_get_attachment_src / get_post_thumbnail_id?
- Modern Tribe Calendar wp-query with meta query not working at all
- Count number of published posts by type
- How to display custom field on homepage
- WP_Query sort using multiple numeric meta values
- Can an array be used as a meta_query value?
- Can’t increase posts_per_page by variable
- WordPress WP_Query() Not working properly
- Get taxonomy terms only of the WP_Query current posts
- How to get to a specific position in wp_query?
- Get category name from custom loop and echo it once
- WP_Query loop, does not display special characters in title correctly
- Remove query string specific key value
- Hide post if matches current month and year
- Use WP_Query in shortcode
- Why is variable not working on custom sql query using wpdb?
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- Random order of WP_Query results with highest meta value
- get current custom post ID by WP_Query method
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create WP_Query to search for posts by their categories or their parent/child categories
- If Query In Sidebar
- Loading the same WP_Query in two different wordpress .php templates
- How to prevent WP_Query function from returning all posts when empty?
- Dynamic content based on a URL parameter
- Get users that likes the post
- inserting a post from an extern php file but post content doesn’t show on wp site
- unable to use ‘new WP_Query’ in AJAX call
- wp_query get the 2nd post
- How to add div blocks after certain set of post
- Convert a string into a decimal number for use in query
- Increment paged on WP_Query
- Hide posts if user is added to it WP_query
- How to hide posts of a specific custom category in WordPress?
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- Modify main query before it run without pre_get_post
- WordPress WP_Query without query GET parameters
- Sort posts in a specific way
- posts_nav_link pulling in multiple post types
- displaying a fall back query if there’s nothing in the post-type category
- Modifying WP URL handing code?
- Free search and custom taxonomy query not providing the same result
- How do I reset $wp_query in a function?
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- wp_query with multiple arguments with AND
- Replace a single variable with add_filter
- Nested Queries of decreasing specificity
- Wrong pagination results, page counter resets when navigating
- Is it possible to order posts using multiple meta queries, i.e. show posts from first meta query, then the second?
- Sending simple variable on single page to WP JSON
- How to exclude meta no index pages from wp_list_pages
- in_array not working on dev server but works on localhost
- meta_query search names when they have middle initials
- WP query posts BUT show the most recent and one per author
- Define global custom post
- get_filtered_term_product_counts – Get product terms if any products
- Search for single post by 2 tags
- List all ACF field values across every post on one page
- Multiple Arrays for Custom Post Query using Boostrap accordions and ACF repeater fields
- Query to show average # of months all accounts with specific role have been active
- Woocommerce Related Product by 2 taxonomy
- Query doesn’t display text data with apostrophes
- Querying posts from wordpress with 2 or more conditionals
- SQL Query Search page
- Can’t get data from audio media
- Display Year and Month from custom field + Age Calculator
- insert thumbnail image from php script
- WP_Query count of different meta key values [duplicate]
- Masonry layout within the loop
- Fix incorrect related posts code snippet
- wp_query on search results page showing all results every time
- Changing regular db connection to $wpdb
- Variable ++ in query loop
- XML WP_Query problem in PHP 8.0 and 8.1
- a problem in class in class-wp-hook.php
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Count custom posts type and filter by tag
- AJAX WP_Query’s order and orderby parameters not working
- How to sort search result by post_title, then by post_content
- How do I display WooCommerce products in my query to rows of 3?
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress
- Exclude first post from wp query
- 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?