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?
- Query multiple custom post types in single loop
- 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
- Build a content and excerpt grid loop with paging and options for # of posts
- retrieve thumbnail from post ID of best selling product in category
- How to create a WP_Query to search the Title or Tag?
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Passing JSON data from WP Query into AJAX causing NULL errors
- Using Cookie Data For WP_Query Loop
- AJAX / Read More: multiple check_ajax_referer() and wp_create_nonce() not working independentely
- wp_delete_post deletes all posts instead of just expired ones
- Display certain amount of posts on taxonomy archive page
- Alter secondary loop to exclude posts from current page category
- Result of Custom WP_Query appears on 404 Page (but result are found!)
- Show only one post for each author ( Page loads too slow )
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- how to display active, upcoming and past event with featured listing with pagination
- How to add 2 posts under another post? Formatting should be intact
- Trim first 2 words of the exceprt
- 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
- if statement on database query
- WP_Query use for a filter with multiple Taxonomies and Terms
- Duplicates with WP_Query loop
- WP_Query meta_query results date by date
- Count number of published posts by type
- How to display custom field on homepage
- Display Post co-authored in Author Page
- WP_Query sort using multiple numeric meta values
- Can an array be used as a meta_query value?
- Display related products with custom output
- Help with adding pagination to custom wp_query
- Can’t increase posts_per_page by variable
- How do I dynamically generate args for wp_query?
- WordPress WP_Query() Not working properly
- Sorting Posts | Alphabetical Order
- 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
- Looking for most performant way to execute several similar WP queries within shortcodes
- API response to be stored locally
- 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
- Get the last month with posts using a recursive function…
- Use WP_Query in shortcode
- have_posts() execution failure
- How to filter posts by post format “standard” from wp-json api?
- 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?
- Can’t search posts using WP_QUERY inside AJAX Function
- How to query for pages/post depending on slug?
- How can I use wp_query to show all product data using just the products ID?
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Random order of WP_Query results with highest meta value
- Custom page archive query by url var calling page twice on one of my custom queries?
- WordPress custom slug (endpoint) and compare all links
- How to query for posts with a null or blank post_name?
- WordPress pagination not working with search page
- get current custom post ID by WP_Query method
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Using foreach loop breaks
- Recent posts with featured image or fallback image with permalink
- Create WP_Query to search for posts by their categories or their parent/child categories
- WP Query with custom Shortcode
- wp_query with cat not working
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- How to use an associative array in post__in with WP_Query?
- If Query In Sidebar
- Compare post-IDs within WP_Query? (Less than / Greater than)
- How to use $query->set with post__in?
- Execute multiple PHP Snippets causes error?
- 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
- Three different queries on same page
- How to sort custom sortable column by custom table value
- /page/2/ redirect to 404
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- AJAX WP_Query’s order and orderby parameters not working
- Add adjacent post function inside custom recent post function
- How to sort search result by post_title, then by post_content
- How do I exclude the current post from the upcoming post query
- 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
- wp_logout action hook is not firing
- How to show correct td of table tags in wp_query loop
- Exclude first post from wp query
- Show post in elementor based on views and specific category with query id feature in elementor
- Check for a value in a custom query
- How to make posts_like_dislike reference current post when iterating?
- AND and OR in my CPT search query depending on checkbox
- Add css class ID to largest and smallest number a custom field in wp_query