Interesting find! As I have already mentioned, I am working with my simpleX WordPress Theme. I didn’t have the functions.php page as I thought I didn’t require it. So, what next? I wanted to customize my sidebar css. I thought ‘are they widgets?’ So, there I go. Design -> Widgets and BOOM! I see a red highlighted box with No Sidebars Defined error.
I was going back and switching to default theme to see if I made a mistake. Switching back to default theme gave me the access to the widgets. So, I went back and switched to simpleX. Again the same error.
Fortunately, there was a link that explained why I got that error. Well, it listed everything I knew. Then I came to the middle section where it pointed out something about functions.php.
Here is an example of functions.php for a theme that does not yet have such a file (no blank lines at the beginning or end of the file, please):
1234 <?phpif ( function_exists('register_sidebar') )register_sidebar();?>That’s it, just four lines. This code tells the plugin that your theme will need exactly one dynamic sidebar. At this point, your admin interface should have an extra item in the Presentation menu: Sidebar Widgets.
Surely, I created the functions.php with those 4 lines and OH YES! I can now access my widgets!
So, if you are wondering what happened to your widgets, you may be missing the functions.php. Check it out!
Thanks a lot for the valuable information
Awesome mate, just awesome. My favourite type of troubleshooting post, where you have a simple problem and make it easy as for folks like me to find a solution.
Many thanks, you are surely the Man.
Thanks a lot friend, its a very useful information for me.,. i was trying to fix this error from last two days.. but it resolved within just 1 min when i check this page.. really a great help… I was missing functions.php file in my new theme..
Many Thanks !
Great.. I had the same issue. I wrote it down so it might be helpful for others as well. Good that it became helpful for you as well.
thanks, i did it
That was great. Thanks for the tip.