Ok, I registered a new sidebar and have added some functionality to my theme so you can choose which sidebar to display from the back-end (using meta fields). It's working on all pages, except on a custom-page.php I created.

I've tried just about anything and can't get my head around why my selected sidebar isn't displaying on page.php (default sidebar is displaying), but not on custom-page.php. I might be overlooking something minor, but for now it's doing my head in. Any help would be greatly appreciated.

2 Answers 2


Do you have the following line in your custom-page.php:

<?php get_sidebar(); ?>


  • I can call it directly <?php dynamic_sidebar( 'gear-sidebar' ); ?> which will display the correct sidebar next to the old one. Don't know why the "dynamic part" of calling it isn't working on this custom page, while it is on the regular pages.
    – WouterB
    Sep 20, 2011 at 12:54

Found the solution. I forgot to add wp_reset_query(); which should always be added when using custom queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.