Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development Custom Post Type Templates in WordPress The Portfolio Homepage

David Alberto Mogollon
seal-mask
.a{fill-rule:evenodd;}techdegree
David Alberto Mogollon
Full Stack JavaScript Techdegree Student 13,759 Points

i keep getting this message Fatal error: Maximum function nesting level of '100' reached,

I followed the video step by step.

<?php
$args =array('post_type' => 'portfolio');
$query = new WP_Query($args);
?>

      <section class="row no-max pad">

          <?php if($query -> have_post()): while ($query->have_post()): $query->the_post();?>

              <div class="small-6 medium-4 large-3 columns grid-item">
                <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('large');?></a>
              </div>

          <?php endwhile; endif; wp_reset_postdata(); ?>

      </section>

2 Answers

David Alberto Mogollon
seal-mask
.a{fill-rule:evenodd;}techdegree
David Alberto Mogollon
Full Stack JavaScript Techdegree Student 13,759 Points

I found my error, in the conditional statement, i used have_post() instead of have_posts(), how ever, i still not getting any image on my portfolio page

David Alberto Mogollon
seal-mask
.a{fill-rule:evenodd;}techdegree
David Alberto Mogollon
Full Stack JavaScript Techdegree Student 13,759 Points

I made it work, it also shows images. the thing is, im working with more plugins than the current plugins in this video, im guessing there are some conflicts when using the theme with those plugins,

i recomend to deactivate all the plugins except for those that we use in this course.

it may fix the problem.