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

Amil Cook
Amil Cook
1,088 Points

Maximum function nesting level of '100' error when creating portfolio page

I am getting the following error "maximum function level of 100" from the query.php line 3999

I am not even working in that file. I am only in the page-portfolio.php file and I added the code as the video demonstrates. I am thinking that maybe I didn't set the query to no conflict but I double checked and I did.

Any assistance would be greatly appreciated...Thanks!

Here is my code on the page-portfolio.php :

<?php get_header(); ?>

 <section class="row">
      <div class="small-12 columns text-center">
        <div class="leader">

 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

            <h1><?php the_title(); ?></h1>
            <?php the_content(); ?>        

         <?php endwhile; endif; ?>

          </div>
        </div>
    </section>

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

?>


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

    <?php if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_posts(); ?>

      <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>



<?php get_footer(); ?>
Amil Cook
Amil Cook
1,088 Points

I think I see what I am doing wrong...I am using the incorrect page template to build the portfolio. I should be using page-sidebar-left and I was using page.php. Let me try to fix my code and see what happens?

Amil Cook
Amil Cook
1,088 Points

I'm all confused I am struggling not with the single-portfolio page but the page-portfolio or portfolio home page...I will keep at it and see what I can do.

1 Answer

Amil Cook
Amil Cook
1,088 Points

I just redid my coding on this page and got it to work...I think it is a little challenging to follow the coding of Zach 100% because his code lines are not available except when they are present on the screen. Still the best development site for learners around!