I am working on a wordpress site (my first), where I want to use a specific sidebar for a specific page template. The sidebar is not the regular widget area, but a template (sidebar-2.php) that calls another template (boeking.php) of a form.
I used the default page.php and sidebar.php as a starting point, copied almost everything, and thus created a template for the page (reisbeschrijving.php) that calls sidebar-2 by using get_sidebar('2')
. I also created a template sidebar-2.php:
It worked at first, but while I was working on another part of the website it stopped working all of a sudden. The page template works fine, but it doesn't load the sidebar-2, because the is_active_sidebar()
returns false. However, I don't know why it returns false. When I call get_sidebar()
(default) in reisbeschrijving.php, it does display sidebar.php, and is_active_sidebar()
returns true. If I remove the if is_active_sidebar()
clause, sidebar-2 displays just fine. both sidebar.php and sidebar-2.php are in the same folder (of the child theme).
Did I miss something? Should I register the new sidebar-2 template somewhere in the header or something? I know that this is the case for the custom dynamic sidebars with widget area's, but this is an altogether new template and I thought I wouldn't have to (I tried anyway, but to no avail).
Any hints on why is_active_sidebar
returns 'false' on my second sidebar is greatly appreciated.
register_sidebar()
documentation. – disinfor