Support » Plugin: Theme Blvd News Scroller Widget » Plugin not working on WP 3.5

  • Resolved tinuviel

    (@tinuviel)


    Just installed the plugin this evening. For some reason, nothing is showing up in the sidebar of our site. We have multiple posts in each category being referenced. It appears to be ID’ing the widget by the number by which the db references it (ie: we created 3 widgets, deleted 2 of them, and the 3rd is still on the page).

    The issue that seems to be happening is that the JQuery script is looking for a widget ID’d as “themeblvd_news_scroller-3”, and yet on the page there isn’t even a DIV named “themeblvd_news_scroller” – let alone with a -3 at the end. Instead, there is a DIV with class “themeblvd-news-scroller”.

    http://wordpress.org/extend/plugins/theme-blvd-news-scroller/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Okay, my partner figured it out.

    Go to line 319 in the plugin file theme-blvd-news-scroller/news-scroller.php, and replace the current code with this:
    <div id=”<?php echo $widget_id; ?>” class=”themeblvd-news-scroller flex-container”>

    It’ll at least work until the next update, which will hopefully fix the issue anyway.

    Plugin Author Jason

    (@themeblvd)

    Hello,

    This actually sounds like a bit of a theme issue. It is pretty standard in a WordPress theme that when you register your sidebar you want to have the “before_widget” argument contain the ID of the current widget and standard classes in the markup.

    Also note that when you call register_sidebar in your theme to setup the sidebar, if you don’t override the “before_sidebar” argument, WordPress already does this for you by default.

    So, this means that in your theme when the sidebar is registered, the theme author has (a) passed in their own “before_widget” argument and (b) didn’t include the id="%1$s" part.

    For example, if you were you to call register_sidebar() with no arguments passed in, WordPress will use the following arguments by default:

    $args = array(
    	'name'          => __( 'Sidebar name', 'theme_text_domain' ),
    	'id'            => 'unique-sidebar-id',
    	'description'   => '',
    	'class'         => '',
    	'before_widget' => '<li id="%1$s" class="widget %2$s">',
    	'after_widget'  => '</li>',
    	'before_title'  => '<h2 class="widgettitle">',
    	'after_title'   => '</h2>'
    );

    If you want to adjust the “before_widget” and “after_widget” markup in a theme, that’s totally fine, but just make sure that you always include the ID and standard classes in the surrounding markup something like this:

    $args = array(
    	'name'          => __( 'Your Sidebar', 'theme_text_domain' ),
    	'id'            => 'your-sidebar',
    	'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    	'after_widget'  => '</aside>'
    );
    register_sidebar( $args );

    This will ensure that widget plugins out there that rely on $before_widget parameter when displaying the widget will work more consistently with your theme.

    Plugin Author Jason

    (@themeblvd)

    [resolved]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin not working on WP 3.5’ is closed to new replies.