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 trialJeffrey Cunningham
5,592 PointsReceiving a strange error when adding in wp_head();.
When I add in the wp_head(); function in place of the stlye and JS links I get this strange error.
Fatal error: Maximum function nesting level of '100' reached, aborting! in /Users/jeff/Documents/Websites/www.sandbox.dev/wp-includes/cache.php on line 511
I can't figure this out for the life of me. Someone please help.
3 Answers
Jeffrey Cunningham
5,592 PointsI figured it out now. I should have posted a screenshot of the error message. I was calling wp_enqueue_scripts instead of wp_enqueue_script. This resulted in the page calling that hook over and over again.
This brings up a bigger question, is there a way to attach screenshots here?
Zac Gordon
Treehouse Guest TeacherCan you post up your code please
Jeffrey Cunningham
5,592 PointsThis is the code in my header.php file. It breaks as soon as I put the wp_heade(); in.
<!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title><?php wp_title(); ?></title>
<?php wp_head(); ?>
</head>
<body> <header class="row no-max pad main"> <h1><a class='current' href="index.html">G</a></h1> <a href="" class="nav-toggle"><span></span>Menu</a> <nav> <h1 class="open"><a class='current' href="index.html">G</a></h1> <ul class="no-bullet"> <li class="current parent"><a class='current' href="index.html">Portfolio</a> <ul class="sub-menu"> <li><a href="item.html">Portfolio Item</a></li> <li><a href="item.html">Portfolio Item</a></li> <li><a href="item.html">Portfolio Item</a></li> <li><a href="item.html">Portfolio Item</a></li> </ul> </li> <li class="parent"><a href="blog.html">Blog</a> <ul class="sub-menu"> <li><a href="single-post.html">Single Post</a></li> <li><a href="author.html">Author Page</a></li> </ul> </li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header>
Zac Gordon
Treehouse Guest TeacherI'm not seeing the wp_head() code included here.
Jeffrey Cunningham
5,592 PointsIt is right under title and above the <header class="row no-max pad main">. For some reason the comments section broke up my code into two separate blocks. It is in the first block.
Zac Gordon
Treehouse Guest TeacherZac Gordon
Treehouse Guest TeacherNice, glad you got it :)
No file uploads, but you can embed an image uploaded somewhere using markdown :)
Jeffrey Cunningham
5,592 PointsJeffrey Cunningham
5,592 PointsCool, thanks for you help Zac.