WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

<?php get_sidebar(); ?>


share|improve this answer
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 '11 at 12:54
up vote 0 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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