danixland
Member
Posted 10 months ago #
Hello everybody, I have this code on pastebin and I'm trying to make it work..
if I comment out the is_active_sidebar part and print the $count value it returns "3" as it should, but if I go for the is_active_sidebar (and comment out the first $count++ of course) and I'm sure all 3 widget areas are active it returns "1" no matter what I do..
Do you see something wrong??
thanks in advance!! :)
s_ha_dum (was apljdi)
Member
Posted 10 months ago #
is_active_sidebar() must be returning false. That suggests that your sidebar names are wrong or that you are running the function before the sidebars have been initialized. There may be other possibilities as well but those are the ones that come to my mind. Try putting this at the very top of your function and see what you get:
global $wp_registered_sidebars;
var_dump($wp_registered_sidebars);
danixland
Member
Posted 10 months ago #
thanks for your reply apljdi, I have to apologize, it was my mistake since I wasn't passing the correct ids of my sidebars, so is_active_sidebar() was obviously returning false..
The function works well, so thanks again and sorry for all the noise.. ;)