Support » Plugin: Widget Options - Add Context To WordPress Widgets » Plugin Not Honoring is_active_sidebar Conditional Tag

  • Resolved katart17

    (@katart17)


    I have a widget that needs to show on ONLY one page within a sidebar/widget area. The problem I’m having is that all the other pages think there is an Active Widget in that Sidebar.

    The theme uses the is_active_sidebar() conditional tag to remove the sidebar if there are NO active widgets. If there is NO active widget (or hidden widget) on the specified page, I would assume the plugin should honor the is_active_sidebar() conditional tag.

    Can this be done?

    • This topic was modified 3 years, 1 month ago by katart17. Reason: change title
Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Contributor Jeffrey Carandang

    (@phpbits)

    Hi,

    Thank you very much for choosing Widget Options! Regarding your concern, are you hiding the widgets per devices? This feature uses CSS media query and is_active_sidebar will return positive. Media query is the best option to ensure that the plugin will work even when caching plugin is installed. If in any case you are hiding widget on mobile and don’t have any caching installed you can use the Display Widget Logic and add wp_is_mobile().

    Let me know how it goes. Thanks!

    Cheers,
    Jeffrey

    @phpbits I’m hiding based on Post Type. I’m using the Post Type option, but if I used the Display Widget Logic option, I would use is_page($page_id).

    Same thing happening for me. I have 3 widgets in an area but none are checked to show on my page, yet is_active_sidebar is returning true.

    Me, too. I don’t have time to look at the code to see what’s wrong, but I’m adding this so I can be notified of progress resolving it. In the meantime, I’ll have to Disable the plugin and work around a different way.

    I’m having the same problem. I have a sidebar that I want to hide if is_active_sidebar is not active. However, even if this plugin is not displaying the sidebar content it appears the sidebar is still active. This is a problem for me because I have surrounding code and content that I do not want to appear if the sidebar is empty. Is there a way to test for something similar to is_active_sidebar? Thanks. Great plugin!

    • This reply was modified 3 years, 1 month ago by expient.
    Plugin Contributor Jeffrey Carandang

    (@phpbits)

    Thanks everyone! Would you mind checking if the fixes I’ve added are working perfectly? You can download the files here : https://github.com/phpbits/widget-options/tree/develop

    This version also has the brand new Move Widget Feature and I hope you’ll test it out too and let me know how it goes. Go to Settings > Widget Options and enable the Move Widget feature. Below the is the video on how this feature works :

    Thank you very much for choosing Widget Options!

    Cheers,
    Jeffrey

    Plugin Contributor Jeffrey Carandang

    (@phpbits)

    Hello again everyone,

    Just realized that github version will give you widget-options-develop folder which isn’t recommended. Please download the development with fixes here. Thank you very much!

    Cheers,
    Jeffrey

    Thanks. I installed from the link above labeled “here” version 3.3.2. I’m still seeing thinks that should be filtered out by “is_active_sidebar”. Is there something else I need to do? I did go in and re-save the widgets that have widget-options.

    Plugin Contributor Jeffrey Carandang

    (@phpbits)

    @expient please download the version 3.4 on my reply above and let me know how it goes. Thanks!

    Cheers,
    Jeffrey

    Thanks. I won’t be able to try this until tonight. I’ll let you know how it goes.

    @phpbits That seemed to work for me. Thanks!

    Plugin Contributor Jeffrey Carandang

    (@phpbits)

    @katart17 Sounds perfect! I hope you’re loving the other brand new features too! Thanks!

    Cheers,
    Jeffrey

    Works great! Thanks. Awesome plugin!

    Thanks for the quick fix.

    Plugin Contributor Jeffrey Carandang

    (@phpbits)

    @expient Perfect! You are very welcome 🙂 I’ll be marking this as resolved now. If in any case anyone encounters any other issue please do not hesitate to create another one. Thanks again for choosing Widget Options!

    Cheers,
    Jeffrey

    @phpbits
    Hi sir, thank you for this wonderful plugin. However where is the 3.4 version? I installed the plugin but I only have 3.3.2 version and it said it is the latest version. im having the same problem in this thread.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Plugin Not Honoring is_active_sidebar Conditional Tag’ is closed to new replies.