Forums

Code to Detect Widgets in Sidebar (2 posts)

  1. RockyMtnHi
    Member
    Posted 1 year ago #

    I need the code to detect if a widget is in a sidebar or not the code to detect sidebars is:

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebarPageInnerRight') ) : ?>
     I NEED CODE HERE TO DETECT A WIDGET
    <td id="right-inner">
    </td>
    <?php endif; ?>

    Is it possible to add code to the noted section above to determine whether a widget has been placed onto the sidebar in the Widgets section of WordPress?

    The reason I need this is so the <td> column won't take the space if there are no widgets loaded into the sidebar.

    Thanks for your help.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic