Solved

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

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

730 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