SHARE
TWEET

Untitled

a guest Jun 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function show_product_pages() {
  2.  
  3. global $post;
  4. $child_pages_query_args = array(
  5.     'post_type'   => 'page',
  6.     'post_parent' => $post->ID,
  7.  
  8. );
  9. $child_pages = new WP_Query( $child_pages_query_args );
  10.  
  11. if ( $child_pages->have_posts() ) :
  12. ?>
  13. <div class="columns product-archives">
  14. <?php
  15. while ( $child_pages->have_posts() ) : $child_pages->the_post();
  16.     ?>
  17.         <div class="col col-md-4">
  18.             <a href="<?php the_permalink(); ?>">
  19.                 <div class="product_thumb"><?php the_post_thumbnail(array(240, 240)); ?></div>
  20.                 <h3 class="product_title"><?php the_title(); ?></h3>
  21.             </a>
  22.             <div class="product-desc"><?php the_content($post->ID); ?></div>
  23.             <a class="cta-link" href="<?php the_permalink(); ?>">Learn More </a>
  24.         </div>
  25. <?php endwhile; ?>
  26. </div>
  27. <?php endif;
  28. wp_reset_postdata();
  29. }
  30. add_shortcode('show_product_pages', 'show_product_pages');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top