Title: Missing template in widget
Last modified: August 21, 2016

---

# Missing template in widget

 *  Resolved [brainburner](https://wordpress.org/support/users/brainburner/)
 * (@brainburner)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/missing-template-in-widget/)
 * The widget function doesn’t propagate the before_title, after_title arguments
   set by the template.
 * The following diff solves the problem.
    $ diff widgets.php widgets.php.new 35a36,37
   > ‘before_title’ => $before_title, > ‘after_title’ => $after_title,
 * [https://wordpress.org/plugins/multi-rating/](https://wordpress.org/plugins/multi-rating/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [dpowney](https://wordpress.org/support/users/dpowney/)
 * (@dpowney)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/missing-template-in-widget/#post-5133659)
 * Hi brainburner,
 * Do you mean shortcodes.php? I just found these attributes are not being passed
   to the underlying API.
 * There is no option to pass in a before_title or after_title for the Top Rating
   Result widget.
 * Thanks,
    Daniel
 *  Thread Starter [brainburner](https://wordpress.org/support/users/brainburner/)
 * (@brainburner)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/missing-template-in-widget/#post-5133677)
 * I mean the “Top Rating Result widget”.
    Currently the widget doesn’t fit the 
   layout of the template, because the after_title, before_title arguments are not
   passed to the API.
 * Adding the two lines solves it.
    Multi_Rating_API::display_top_rating_results(
   array( ‘limit’ => $limit, ‘title’ => $title, ‘before_title’ => $before_title,‘
   after_title’ => $after_title, ‘show_category_filter’ => $show_category_filter,‘
   category_id’ => $category_id, ‘class’ => ‘widget’ ) );
 *  Plugin Author [dpowney](https://wordpress.org/support/users/dpowney/)
 * (@dpowney)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/missing-template-in-widget/#post-5133678)
 * I’m a bit confused. There is not an option for the Top Rating Results widget 
   to pass in before_title or after_title. But the shortcode [display_top_rating_results]
   has the bug you’ve identified above. I’ve added the lines above to the shortcode.
   php file and this will be available in the next release of the plugin. Thanks,
 *  Thread Starter [brainburner](https://wordpress.org/support/users/brainburner/)
 * (@brainburner)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/missing-template-in-widget/#post-5133684)
 * Yes, the bug is also present in the shortcode.
 * But, if I understand it correctly, in widgets.php line #33 you call the same `
   Multi_Rating_API::display_top_rating_results` function.
 * WordPress will call the function `Top_Rating_Results_Widget::widget($args)` where`
   $args` contains ‘after_title’ and ‘before_title’ (or at least it does with some
   themes).
    At line #33 you call the `Multi_Rating_API::display_top_rating_results`
   ignoring these arguments.
 * Propagating the arguments from `Top_Rating_Results_Widget::widget($args)` to `
   Multi_Rating_API::display_top_rating_results` solved the problem on my website.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Missing template in widget’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/multi-rating_d6dfe6.svg)
 * [Multi Rating](https://wordpress.org/plugins/multi-rating/)
 * [Support Threads](https://wordpress.org/support/plugin/multi-rating/)
 * [Active Topics](https://wordpress.org/support/plugin/multi-rating/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multi-rating/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multi-rating/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [brainburner](https://wordpress.org/support/users/brainburner/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/missing-template-in-widget/#post-5133684)
 * Status: resolved