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 trialbuckaroobanzai
482 PointsSidebar only shows up on Blog page
For some reason, my Sidebar only appears on the Blog page. I ran all my code through HTML and PHP validators, but was unable to figure out what I'm doing wrong.
The PHP validator gave me the following error message: "Sidebars need to be registered in a custom function hooked to the widgets_init action. See: register_sidebar()."
Can anyone give me advice as to what specific PHP files I should be focusing on, to correct the issue?
Thanks in advance.
2 Answers
Paulius Vitkus
24,230 PointsCould you paste your register_sidebar() code there? According to error, there is something wrong with sidebar registering.
Victoria Felice
14,760 PointsIn my case, the Sidebar appeared at the very bottom of the "uncategorized" page. I had to add a missing closing tag </div> after "?php get_sidebar(); ?" on line 47 (archive.php file) in order for the Sidebar to show up properly on that page. Try and see if it helps you as well.
buckaroobanzai
482 PointsVictoria, thanks for your response. I checked my archive.php file, and I do seem to have a closing tag after "?php get_sidebar(); ?" on line 47. So, there must be something else that I am overlooking. I will have to go through my code again and see what else might be amiss.
buckaroobanzai
482 Pointsbuckaroobanzai
482 PointsPaulius, here is my code for register_sidebar():