• Resolved danixland

    (@danixland)


    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!! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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);
    Thread Starter danixland

    (@danixland)

    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.. 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘iterating through array’ is closed to new replies.