Solved

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

Posted on 2011-02-28
4
289 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
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
R-Byter earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the solution.
0
 
LVL 14

Expert Comment

by:R-Byter
Comment Utility
You're welcome and thanks for the points.

Regards
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now