Title: generic view posts
Last modified: August 22, 2016

---

# generic view posts

 *  Resolved [imransilvake](https://wordpress.org/support/users/imransilvake/)
 * (@imransilvake)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/generic-view-posts/)
 * I have 2 categories:
    1. Games with view: <?php echo do_shortcode(‘[pt_view id
   =”XXX”]’); ?> 2. Music with view: <?php echo do_shortcode(‘[pt_view id=”YYY”]’);?
   >
 * Now can you tell me how can i get only games post when i click on the Games category.
   Should not display Music posts.
 * and when i click on the Music Category, only Music posts should display and not
   the Games.
 * How can i achieve this in generic sense?. Hope you get my question.
 * [https://wordpress.org/plugins/content-views-query-and-display-post-page/](https://wordpress.org/plugins/content-views-query-and-display-post-page/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Content Views](https://wordpress.org/support/users/pt-guy/)
 * (@pt-guy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/generic-view-posts/#post-5369703)
 * Hi,
 * Does each Views XXX, YYY work like you expect in Preview panel?
 * And what is code you are using to show posts on Games category page, Music category
   page?
 *  Thread Starter [imransilvake](https://wordpress.org/support/users/imransilvake/)
 * (@imransilvake)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/generic-view-posts/#post-5369725)
 * **I am explaining you what I am doing**
 * 1. First, I am making a custom theme. no other theme used.
    2. Second, I have
   a page called ‘single.php’ for showing posts (full content of the clicked post).
   It directs to this page when click on a particular post. 3. Third, for showing
   all posts, I have a page called ‘index.php’. When you select a category, it should
   filter the posts and display the selected category posts which in case of using
   your plugin is not working. 4. On plugin Preview, Games posts are showing e.g(
   post 4, and post 5). 5. On plugin Preview, Music posts are showing e.g (post 
   29, and post 33).
 * **What I Want:**
 * 6. Using your plugin, how can I show all posts when no category is selected. (
   on index.php)
    7. Using your plugin, how can I show only those posts when a particular
   category is selected. (on index.php)
 * **I think this sums up My all question.**
 * Note: (below code does what I am asking but I want to style the Posts that’s 
   why I am using your plugin)
 * **
    index.php File:
 * **Showing MY categories:**
 *     ```
       <?php wp_list_categories('orderby=name&title_li='); ?>
       ```
   
 * **showing My content (Posts):**
 *     ```
       <?php while (have_posts()) : the_post(); ?>
         <h3>
            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
         </h3>
         <p><?php the_excerpt(); ?></p>
         <p class="text-muted">Posted by: <?php the_author(); ?> on <?php the_time('F jS, Y'); ?></p>
       <?php endwhile; wp_reset_query(); ?>
       ```
   
 *  Plugin Author [Content Views](https://wordpress.org/support/users/pt-guy/)
 * (@pt-guy)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/generic-view-posts/#post-5369793)
 * As I understand, do you want somethings like this [http://sample.contentviewspro.com/shuffle-filter/](http://sample.contentviewspro.com/shuffle-filter/)?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘generic view posts’ is closed to new replies.

 * ![](https://ps.w.org/content-views-query-and-display-post-page/assets/icon.svg?
   rev=2932226)
 * [Content Views - Post Grid & Filter, Recent Posts, Category Posts ... (Shortcode, Gutenberg Blocks, and Widgets for Elementor)](https://wordpress.org/plugins/content-views-query-and-display-post-page/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-views-query-and-display-post-page/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/)
 * [Active Topics](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Content Views](https://wordpress.org/support/users/pt-guy/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/generic-view-posts/#post-5369793)
 * Status: resolved