Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function show_product_pages() {
- global $post;
- $child_pages_query_args = array(
- 'post_type' => 'page',
- 'post_parent' => $post->ID,
- );
- $child_pages = new WP_Query( $child_pages_query_args );
- if ( $child_pages->have_posts() ) :
- ?>
- <div class="columns product-archives">
- <?php
- while ( $child_pages->have_posts() ) : $child_pages->the_post();
- ?>
- <div class="col col-md-4">
- <a href="<?php the_permalink(); ?>">
- <div class="product_thumb"><?php the_post_thumbnail(array(240, 240)); ?></div>
- <h3 class="product_title"><?php the_title(); ?></h3>
- </a>
- <div class="product-desc"><?php the_content($post->ID); ?></div>
- <a class="cta-link" href="<?php the_permalink(); ?>">Learn More </a>
- </div>
- <?php endwhile; ?>
- </div>
- <?php endif;
- wp_reset_postdata();
- }
- add_shortcode('show_product_pages', 'show_product_pages');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement