Error: cannot ajaxify WordPress Popular Posts on this sidebar.
It’s missing the id attribute on before_widget (see
register_sidebar for more).
I fixed this in hemingway/functions.php on lines 161, 170, 181, 191
- 'before_widget' => '<div class="widget %2$s"><div class="widget-content">',
+ 'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-content">',
https://developer.www.ads-software.com/reference/functions/register_sidebar/
HTH
]]> register_sidebar(array(
'name' => "Home",
'id' => 'home',
'description' => "Sidebar Home",
'before_widget' => '<div class="content-widget test">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
));
But when checking html i got twice (repeated) the widget div wrapper like this:
<div class="content-widget test">
<div class="content-widget test">
...The sidebar content...
I have used this for years with no problem Now I just figured out this. … it is a wordpress last version issue?
]]>I tried using it as a widget but i am getting this error.
Error: cannot ajaxify WordPress Popular Posts on this theme. It’s missing the id attribute on before_widget (see register_sidebar for more).
I will be glad you will help me out
This is my site www.haveyoursay.ng
Thanks
https://www.ads-software.com/plugins/wordpress-popular-posts/
]]>Thanks for the awesome plugin.
By default “before_widget” is set to:
<li id="%1$s" class="widget %2$s">
unless otherwise set while registering the sidebar.
This is adding “widget widget_nav_menu” class for sidebar navigation.
Your plugin is setting before_widget class to empty.
When I add sidebar navigation to my custom sidebar I’m losing the widget style and menu appears un-styled.
I know I can add before widget manually but is it possible to set that function to default WP class?
Thanks
https://www.ads-software.com/plugins/custom-sidebars/
]]>https://www.ads-software.com/plugins/wordpress-popular-posts/
]]>https://www.ads-software.com/plugins/wp-google-map-plugin/
]]>I have just turned on WP_DEBUG to test something, and I noticed that one of my widgets, which is working fine btw, has thrown some errors:
Notice: Undefined variable: before_widget in /wordpress/wp-content/themes/interio/functions/widgets/widget-contactform-support.php on line 24
Notice: Undefined variable: after_widget in /wordpress/wp-content/themes/interio/functions/widgets/widget-contactform-support.php on line 112
This is how I build my widget (which again is working fine):
class Form_Widget_wpse_104728 extends WP_Widget {
//Defining the widget
function widget($args,$instance) {
echo $before_widget;
// Processing the form
- Php code for sending email
//The Form itself
- HTML code for support form
echo $after_widget;
} //Ending function widget
} //ending widget class
Is there anything wrong with the widget itself that could cause this error?
Thanks in advance!
]]>I have wrapped the widget contents in a number of <div> tags. These divs are forming a content box. Its structure is as follows:
<div class="box_container_mid">
<div class="boxheadl"></div><div class="boxheadr"></div>
<div class="boxcontent">
<div class="cont1"></div>
<div class="cont2"></div>
<div class="cont3"</div>
</div>
<div class="boxfooter">
<div class="boxfl"></div>
<div class="boxfr"></div>
</div>
</div>
the way I make my widgets appear in that “box” is by changing some stuff in functions.php in my theme folder:
// Define Sidebar Widget Area 1
register_sidebar(array(
'name' => __('Widget Area 1', 'mytheme'),
'description' => __('Description for this widget-area...', 'mytheme'),
'id' => 'widget-area-1',
'before_widget' => '<div class="box_container_mid"><div class="boxheadl"></div><div class="boxheadr"></div><div class="boxcontent"><div class="cont1"></div><div class="cont2"></div><div class="cont3">',
'after_widget' => '</div></div><div class="boxfooter"><div class="boxfl"></div><div class="boxfr"></div></div></div><div class="leftspacer"></div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
So what I want to do is put the widget title between the <div class=”boxeadl”> and its closing </div> tag, thats where I need the title do appear. How do I do that ?
I also had a look at widgets.php and default_widget.php files tried to think of something myself, but with no success. I will be extremely thankfull if someone helps me with that.
]]>The following code, in the functions file:
if (function_exists('register_sidebar')) { register_sidebar(array(
'name' => __( 'Modules' ),
'id' => 'aside-modules',
'description' => __( 'Place modules here.' ),
'before_widget' => '<section>',
'after_widget' => '</section',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
gives me the mark-up of
<aside>
<section>
<h2></h2>
<ul><li></li></ul>
<h2></h2>
<ul><li></li></ul>
</section>
</aside>
However, the output should be:
<aside>
<section>
<h2></h2>
<ul><li></li></ul>
</section>
<section>
<h2></h2>
<ul><li></li></ul>
</section>
</aside>
]]>I have 3 dynamic widget based sections to my site, and I want to change the surrounding markup from the default list style to a simple surounding div and the h2 tag from the title to a h3 tag.
on my pages I have
<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
<?php endif; ?>
!dynamic_sidebar(2) (this number changing depending on what set of widget I want to appear there.
and in my functions php I’ve tried all sorts of combinations of setting out the below and nothing changes it still displays the list style
if ( function_exists('register_sidebar') ){
register_sidebar(1, array(
'before_widget' => '<div class="clearfix">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(2, array(
'before_widget' => '<div class="clearfix">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(3, array(
'before_widget' => '<div class="clearfix">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
}
no matter what I change from my functions.php nothing changes on the widgets but if i take this section out completely I lost the use of widgets altogether which means it is reading the functions.php only ignoring the array?
Thanks in advanced for any help given, and if I’m being blind to something obvious sorry lol.
]]>