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