WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

Is there a way to get only the sidebars used on a particular page?

Using:

global $wp_registered_sidebars;
$widget_map = wp_get_sidebars_widgets();

Can get me all of the sidebars, but I'm interested in getting the sidebars only for a particular page. Something sounding like get_sidebars_by_page_id()

share|improve this question
    
I'm confused, do you mean get specific widget area from a page? Sometime ago, I created a theme where every page had its own widget area dynamically, so "about page" had a "About" widget area etc. (Please do not use wp_get_sidebars_widgets is deprecated.) – Diana Sep 24 '12 at 19:38
    
The function wp_get_sidebars_widgets isn't deprecated, the codex is referring to its parameter that is deprecated. I mean getting the sidebar IDs of a page if I only know the page object. – Ryan Koehler Sep 24 '12 at 20:20

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.