Ajax support in SWE Accordion Widgets

In Standard Widget Extensions 1.7, Ajax support gets improved. Accordion Widgets continue to work after Ajax update of sidebars. But you may need following customization for better widget behavior.

1. Set the class for heading elements

After Ajax update, heading elements lose classes added by the plugin. So you may need to set the class in your theme. Following is modification for Twenty Fourteen as an example, setting hm-swe-expanded class for headings.

in functions.php

register_sidebar( array(
	'name'          => __( 'Content Sidebar', 'twentyfourteen' ),
	'id'            => 'sidebar-2',
	'description'   => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ),
	'before_widget' => '',
	'before_title'  => '

', 'after_title' => '

', ) );

2. Set Recalc Timer and Count if using Sticky Sidebar

After Ajax update, we need to calculate new sidebar size. To easily accomplish this, use Recalc Timer and Count for periodical calculation. If you set Recalc Count more than 10,000, it behaves as an infinite loop.


9 thoughts on “Ajax support in SWE Accordion Widgets”

  1. Hi, I am a big fan of your plug-in. I am having problems with the Accordion widget after the latest WordPress upgrade. It is no longer working. I was wondering if there is anyway for me to fix this so the Accordion widgets work once again? Thanks.

  2. John,
    Could you tell me which theme you are using? I will investigate. If you could show me your site, it’s much better.

  3. I guess you had used a child theme of Twenty Thirteen and switched to the original. You should change ID of Your Sidebar from ‘mysidebar’ to ‘tertiary’.

    I’ve just learned that recent Twenty Thirteen doesn’t need child theme for going with SWE.

    Have a good weekend!

  4. Thank you very much, I appreciate your work. I would donate if I could. I’m just having one more problem with it. The widget is now working, however it is now in the footer and is no longer a side bar. I am trying to get it back to the sidebar but I am not sure how. I would appreciate your insight. Thanks again.

  5. Check ‘Appearance’ – ‘Widgets’ menu in your site. In Twenty Thirteen, you have ‘Main Widget Area’ for the footer, and ‘Secondary Widget Area’ for the sidebar. Regarding settings for SWE, they have an id of ‘secondary’ and ‘tertiary’, respectively.

  6. Thanks again, I really am sorry to put you through all of this trouble, but I am still having problems with the sidebar being stuck in the footer. I have the following configurations

    ID of your main column: primary

    ID of your sidebar: tertiary

    Class of widgets: Widget

    Disable if window is less than: 999

    I can temporarily make you an administrator to the site if that would help you get a better view of the issue. Thanks again.

Comments are closed.