Code is breaking my template
-
I am creating a template and when i use this code
<?php $subs = new WP_Query( array( 'post_parent' => $post->ID, 'post_type' => 'page', 'meta_key' => '_thumbnail_id' )); if( $subs->have_posts() ) : while( $subs->have_posts() ) : $subs->the_post(); ?> <div class="product"> <? echo get_the_post_thumbnail($post->ID, 'medium'); ?> <?php the_content(); ?> </div> <? endwhile; endif; wp_reset_postdata(); ?>
It breaks my template, “the_content()” text goes right out of the wrapper element. If I replace the code above with static text the same as whats in “the_content()” for my pages it doesn’t break the template.
Whats going on here is another thread post on a another forum i made for the same issue, use it as a reference if needed to help me fix this problem.
https://forums.phpfreaks.com/topic/271328-p-tag-through-parent-element/
Thanks, in Advance
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Code is breaking my template’ is closed to new replies.