Solved

WordPress 3.05 - How to check if a sidebar has widgets?

Posted on 2011-02-28
4
294 Views
Last Modified: 2012-05-11
Hi,
How do we check if a sidebar has widgets? I just want to check without calling it.
In general the following is used to check and call:
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(2)) :

Open in new window


My requirement is just to check and not call.

Please guide.
Thanks
0
Comment
Question by:rajoo_sharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
R-Byter earned 500 total points
ID: 34999405
Look at this topic on Wordpress forum:

http://wordpress.org/support/topic/is_dynamic_sidebar-to-return-false-with-multiple-sidebars

Regards

P.S. I saw you posted same question on wordpress forums. :)
0
 

Author Comment

by:rajoo_sharma
ID: 35004473
Thanks for the reply :)
I did post on WP forum as well.
In fact on WP forum too, I got the reply.
is_sidebar_active function is the answer.
Thanks again.
0
 

Author Closing Comment

by:rajoo_sharma
ID: 35004477
Thanks for the solution.
0
 
LVL 14

Expert Comment

by:R-Byter
ID: 35004912
You're welcome and thanks for the points.

Regards
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to implement server side field validation and display customized error messages to the client.
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question