-
AuthorPosts
-
August 20, 2020 at 9:32 pm #1239625
I am using the search and filter pro plugin to enable advanced search on my site. When the search and filter pro plugin is active, All the posts by author are not displaying, If I click on a author name and go to the author page, there are no posts including custom post types.
But If I deactivate the search and filter pro plugin, the posts are all displayed.
Same goes for pagination too if I can create a custom query and use pagination and click on page 2, I get not found page but if I deactivate the search and filter pro plugin, the pagination works again.
I am so stumped why this would be happening. The only reason I can think of is that both Enfold theme and Search & Filter pro might be using the same syntax for $query.
Any help is appreciated as I am stuck at this from last 4 days
Below is the code I am using in author.php through custom query
$paged = get_query_var('paged') ? get_query_var('paged') : 1; $args = array( 'post_type' => array( 'volunteer-position' ), 'post_status' => array( 'publish' ), 'author' => get_queried_object_id(), 'posts_per_page' => 6, 'paged' => $paged, 'order' => 'ASC', 'orderby' => 'title', ); // query $custom_posts = new WP_Query( $args ); // the loop if ( $custom_posts->have_posts() ): while ( $custom_posts->have_posts() ) : $custom_posts->the_post(); // displaying the posts content here <h2 class="post-title entry-title " itemprop="headline"> <a href="<?php echo get_permalink($post->ID); ?>" rel="bookmark" title="<?php echo get_the_title($post->ID);?>"><?php echo get_the_title($post->ID); ?><span class="post-format-icon minor-meta"></span></a> </h2> endwhile; // using wp-pagenavi as AVIA_PAGINATION not working at all if (function_exists('wp_pagenavi')): wp_pagenavi(array( 'query' => $custom_posts )); endif; else: // nothing found endif; // Restore original Post Data wp_reset_postdata();
August 26, 2020 at 12:40 pm #1240901Hey pepin,
Thank you for the inquiry.
What happens when you hard-code the ID of a specific author instead of using the get_queried_object_id?
'author' => get_queried_object_id(),
We are not familiar with the plugin’s code, so you may need to contact the plugin developers for additional help.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.