• Resolved Alin Ionut

    (@c3dry2k)


    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://www.ads-software.com/plugins/posts-in-page/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Patrick Jackson

    (@pjackson1972)

    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.