Title: Only Pages content
Last modified: August 21, 2016

---

# Only Pages content

 *  Resolved [Alin Ionut](https://wordpress.org/support/users/c3dry2k/)
 * (@c3dry2k)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/only-pages-content/)
 * Hi,
 * I place my code in woocommerce products page
 * `<?php echo do_shortcode('[ic_add_posts post_type="page" template="store-relate-
   pag.php" tag="' . $product->get_sku() .'"]'); ?>`
 * Everything works great, except it retrieve to me not just pages, it retrieve 
   and posts with that specific tag.
 * How to filter the output to display just the pages?
 * [https://wordpress.org/plugins/posts-in-page/](https://wordpress.org/plugins/posts-in-page/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Patrick Jackson](https://wordpress.org/support/users/pjackson1972/)
 * (@pjackson1972)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/only-pages-content/#post-5145963)
 * Hi Alin,
 * I’m sorry you aren’t getting the behavior you’re looking for. I’ve replicated
   the issue, and am still trying to figure out the root cause.
 * In the mean time, you can add another filtering step in your template to exclude
   any but the _Page_ type posts.
 * In your custom template, add the following line above the <!– Start of Post Wrap–
   > line:
 * `<?php if (get_post_type( get_the_ID() ) === 'page') { //if post_type is 'page'?
   >`
 * And at the end of the template, close the if-statement:
 * `<?php } //if post_type is 'page' ?>`
 * Showing more of the template with the middle bits removed…
 *     ```
       <?php if (get_post_type( get_the_ID() ) === 'page') { //if post_type is 'page' ?>
   
       <!-- Start of Post Wrap -->
       <div class="post hentry ivycat-post">
   
       ...  the middle bits for laying out each post listed ....
   
       </div>
       <!-- // End of Post Wrap -->
   
       <?php } //if post_type is 'page' ?>
       ```
   
 * Hope this helps! I’ll keep you posted if I learn more.

Viewing 1 replies (of 1 total)

The topic ‘Only Pages content’ is closed to new replies.

 * ![](https://ps.w.org/posts-in-page/assets/icon-256x256.png?rev=1596190)
 * [Posts in Page](https://wordpress.org/plugins/posts-in-page/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-in-page/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-in-page/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-in-page/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-in-page/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-in-page/reviews/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [page](https://wordpress.org/support/topic-tag/page/)
 * [product](https://wordpress.org/support/topic-tag/product/)
 * [sku](https://wordpress.org/support/topic-tag/sku/)

 * 1 reply
 * 2 participants
 * Last reply from: [Patrick Jackson](https://wordpress.org/support/users/pjackson1972/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/only-pages-content/#post-5145963)
 * Status: resolved