Support » Plugin: amr shortcode any widget » “before_widget” class from custom sidebar added to AMR widgets unexpectedly

  • Resolved cromagrickman


    Hey there, I was hoping to have some help troubleshooting an issue with amr shortcode any widget and my own custom sidebar. Here’s the situation:

    I created a sidebar for widgetizing an area of the home page. Here is my code to register the sidebar (in a plugin):

    * Register our sidebars and widgetized areas. */
    function drick_featured_widget() {
    	register_sidebar( array(
    		'name'          => 'Home Page Featured Properties',
    		'id'            => 'drick_home_feat_prop',
    		'before_widget' => '<div class="home-feat-prop">',
    		'after_widget'  => '</div>',
    		'before_title'  => '<h2 class="home-feat-prop-title">',
    		'after_title'   => '</h2>',
    	) );
    add_action( 'widgets_init', 'drick_featured_widget' );

    It all looks and works fine. However, I noticed that on all the amr shortcode any widget widgets, on every page that has one, also has the “home-feat-prop” div added. This is messing up the styling. I’m wondering if I registered my sidebar incorrectly, or if the amr shortcode any widget conflicts somehow with other registered sidebars?

    Here’s how the custom sidebar I created is added to the home page:

    <?php if ( is_active_sidebar( 'drick_home_feat_prop' ) ) : ?>
          <div class="home-featured-widget-bg">
           <div class="home-featured-widget-wrapper">
              <?php dynamic_sidebar( 'drick_home_feat_prop' ); ?>
           </div><!-- home-featured-widget-wrapper -->
           </div><!-- home-featured-widget-bg -->
        <?php endif; ?>

    Can you see in my code any reason why the widget area class from my custom sidebar is getting added to all the amr shortcode widgets? Thank you in advance for your time!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘“before_widget” class from custom sidebar added to AMR widgets unexpectedly’ is closed to new replies.