How can i check if a certain sidebar is active on a certain page from functions.php using page id or some other page meta data?

  • it depends what do you mean by "active"... do mean if it is in the page layout or has widgets in it..? – majick Jun 7 '16 at 12:29

You mean like this:

if (is_active_sidebar($sidebar-name) && is_page($page-id)) {do your thing}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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