Solved

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

Posted on 2011-02-28
4
292 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

840 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