I am writing a plugin where I need to display the post data inside the loop using the theme content template in a page. It will be a similar page to the author profile page that displays a list of posts but with my own wp_query. I am currently using the following code-
while( $wp_query->have_posts() ) : $wp_query->the_post(); get_template_part( 'content', get_post_format() ); endwhile;
but the problem is this works for some theme and some not. In some theme they don't output anything. Is there any way so I can make it work on all theme or at least maximum theme?