Edit: I just tested and it works perfectly. You’ll also want to remove pagination from the author template.
I haven’t tested it, but have you tried pre_get_posts?
function author_filter($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ($query->is_author()) {
$query->set( 'posts_per_page', 1 );
}
}
}
add_action('pre_get_posts','author_filter');
Related Posts:
- Modern Tribe Calendar wp-query with meta query not working at all
- if statement on database query
- Looking for most performant way to execute several similar WP queries within shortcodes
- Why is variable not working on custom sql query using wpdb?
- 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
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- inserting a post from an extern php file but post content doesn’t show on wp site
- Hide posts if user is added to it WP_query
- Custom route and query
- WordPress WP_Query without query GET parameters
- How to WP_Query posts order by parent title?
- Passing in MySQL prepare statement parameter separately throwing error
- Usermeta data unserialize, extract and display in table in WordPress
- how to get data from two different table from wordpress database
- Query doesn’t display text data with apostrophes
- SQL Query Search page
- How can I display a query in a page?
- Custom query_posts() parameter
- Execute multiple PHP Snippets causes error?
- Can i use php sql functions instead of $wpdb?
- How to validate WordPress generated password in DB using PHP?
- Custom query to get post names beginning with a digit
- How To Make Connection To WordPress Data Base In A Plugin?
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- How can I call a row of user specific data from a custom table added to the WP Database
- How to merge local and live databases?
- WP_Query use for a filter with multiple Taxonomies and Terms
- Successful or Error Message after running mysql code in functions.php
- Display related products with custom output
- Performance issues with large website [closed]
- Create a quick start wordpress installation [closed]
- How do I dynamically generate args for wp_query?
- theme options echoing multiple times
- WordPress 3 – how are passwords stored and how do I compare to them?
- how to echo all tables that start with a prefix
- How to select WooCommerce products by post_meta and order them
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Custom page archive query by url var calling page twice on one of my custom queries?
- Remove one value in dismissed_wp_pointers?
- How to query for posts with a null or blank post_name?
- WordPress pagination not working with search page
- Accessing data from a non-WP database/table within a page content
- WP Query with custom Shortcode
- How can I save unique user data on my site? [closed]
- Add more button if more 8 items
- Ordering users by custom user meta
- Using custom tables for old posts
- Multiple meta_key in one global $wpdb;
- wp_query get the 2nd post
- WordPress member notification
- Moving wordpress site from localhost to live server using GoDaddy cPanel
- How does WP work in conjunction with a web server?
- How to add div blocks after certain set of post
- Location of core code for database connection and get_header
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- Convert a string into a decimal number for use in query
- Increment paged on WP_Query
- How to unserialize data from MySQL
- 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
- Known Issues in WordPress When Upgrading PHP to ver 7
- Sort posts in a specific way
- Get the id of the row from database on click of a button [closed]
- posts_nav_link pulling in multiple post types
- Modifying WP URL handing code?
- SQL error with custom query
- Free search and custom taxonomy query not providing the same result
- How do I reset $wp_query in a function?
- Modify WooCommerce used to get all orders in dashboard
- Replace a single variable with add_filter
- Sending simple variable on single page to WP JSON
- How to exclude meta no index pages from wp_list_pages
- meta_query search names when they have middle initials
- Weird fonts showing which are coming from database
- Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]
- WordPress Bad Request Error 400
- I am facing this error Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- What is the correct way to search 3 custom fields only in WordPress?
- get_filtered_term_product_counts – Get product terms if any products
- cant insert data in a custom table in phpmyadmin
- List all ACF field values across every post on one page
- Multiple Arrays for Custom Post Query using Boostrap accordions and ACF repeater fields
- autocomplete in wordpress using ajax with json-data
- Query to show average # of months all accounts with specific role have been active
- New database entry to trigger runing PHP/SQL query through link with token, without logging into the website
- I want show only data for today
- Querying posts from wordpress with 2 or more conditionals
- Display Year and Month from custom field + Age Calculator
- insert thumbnail image from php script
- Masonry layout within the loop
- How to pass username into form that sends data to database
- Your PHP installation appears to be missing the MySQL … After deleting and restarting from cpanel
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- How to sort search result by post_title, then by post_content
- Can’t insert into a database wordpress
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress