i found a solution to my problem!
function custom_author_archive( &$query ) {
if ($query->is_author)
$query->set( 'post_type', 'idea' );
}
add_action( 'pre_get_posts', 'custom_author_archive' );
Related Posts:
- Using ajax with paging and a custom sub-query
- Help to condense/optimize some working code
- Problem with ‘post__not_in’
- Sort X categories by last update and show image
- using post__in allow duplicate post id
- Pagination on archive.php page
- Having trouble generating pagination links on custom query
- Using dynamic conditions in ‘posts_where’ filter
- How to limit search to first letter of title?
- query_posts and pagination, still stuck after much research
- how could I get the pagination as I want to when query posts using get_posts function
- Counter code for paginated category pages in wordpress
- WordPress Search Filter Only for Page with Child of Child of Child of Child of Child
- How to modify the query to exclude posts by slug?
- How do i paginate query_posts with numeric pagination?
- Pagination on custom query
- Adding Variables to post query
- Custom posts per page does not work with pagination
- Tricky WP Query
- WordPress pagination showing same posts on each page
- query_posts() ALWAYS displays something?
- WordPress pagination with get_posts?
- Custom loops, sticky posts, and pagination nightmare
- Querying posts only if the current page is not paged?
- Each post is showing twice in my custom query…?
- Exclude posts by post meta value
- query_posts pagination will always show identical content
- Can’t get pagination to work for sticky posts only
- How do I use pagination in WordPress?
- Can I use WP_Query one time and then filter the results multiple times
- Pagination linking to first page
- Different layout based on post amount?
- How to solve this without flushing the rewrite rules for each post query the visitor triggers?
- How to check a list or feed of all posts under a category and tag?
- Best Query for blog posts
- Modify main loop query for paged and meta key
- Query Post interferes with Pagination
- Post Filter clearing on pagination $_post
- get_next_posts_link() stops displaying at page 4
- Adding Category Argument into an Array for WordPress Query
- Query posts in a category and include only one post per author?
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- Achieving pagination with `query_posts`
- When should you use WP_Query vs query_posts() vs get_posts()?
- How to fix pagination for custom loops?
- How to Get All Posts with any post status?
- posts_per_page no limit
- Pagination not working with custom loop
- How can i get count from query post
- query_post by title?
- Why query_posts() isn’t marked as deprecated?
- Alternative to query_posts for main loop? [duplicate]
- Wp get all the sub pages of the parent using wp query
- how to query posts by category and tag?
- Using WP_Query to Query Multiple Categories with Limited Posts Per Category?
- Get the ID of the latest post
- How to query for most viewed posts and show top 5
- Order by meta value or date?
- How do I query by post format in WordPress 3.1
- Display posts of the last 7 days
- Is there a way to exclude the content from the post variable to save on RAM usage?
- Filtering posts by post meta data
- WP_Query vs get_posts
- WordPress Paginate $wpdb->get_results
- How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?
- Query posts by custom taxonomy ID
- Display/query post formats
- the_author() returns empty string
- How to query post by user role?
- How to return results of a get_posts() in explicitly defined order
- Custom post type archive 404’s with paginate_links
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- get_query_var(‘paged’) always returns empty
- Custom WP_Query order by post_meta and (author) user_meta
- How to set posts per page using WP_Query()
- query_posts exclude a meta key
- How do I create a random post that will last for a day
- Ensuring sticky posts are retrieved first (without using two queries)?
- Determine if more posts are available than was asked for in `query_posts()`?
- Modify main WordPress loop with a parse_query filter
- Get the number of posts from the current page results
- query_posts() in function makes global $wp_query out of sync?
- Limiting query_posts to 1, regardless of sticky post?
- How to make “sticky” pages (and query by them)
- author.php with ACF and CPTs
- Query posts: how to exclude results if post is in multiple categories
- Query Custom Meta Value with Increment
- query_posts ->using meta_compare / where meta value is smaller or greater or equals
- Is `query_posts` really slower than secondary query?
- How to display posts by current user/author in a custom page template?
- How to order posts by descending comment count on taxonomy page?
- Are there any scenarios where the query_posts may be used?
- Alter query on edit.php
- Get posts by meta data OR title
- Sort posts alphabetically by custom field value, insert divider between different letters
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- WP 5.8 “Query Loop” block: where to place custom query?
- Query posts distinct authors
- Perform query with meta_value date