Title: Error: cannot ajaxify WordPress Popular Posts
Last modified: August 30, 2016

---

# Error: cannot ajaxify WordPress Popular Posts

 *  Resolved [lucascarder](https://wordpress.org/support/users/lucascarder/)
 * (@lucascarder)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts/)
 * > Error: cannot ajaxify WordPress Popular Posts on this theme. It’s missing the
   > id attribute on before_widget (see register_sidebar for more).
 * This errors appears when I try to ajaxify the plugin since I’m using WP Super
   Cache.
 * functions.php
 *     ```
       //register the default sidebar
       register_sidebar(array(
           'name'=> TD_THEME_NAME . ' default',
           'id' => 'td-default', //the id is used by the importer
           'before_widget' => '<aside class="widget %2$s">',
           'after_widget' => '</aside>',
           'before_title' => '<div class="block-title"><span>',
           'after_title' => '</span></div>'
       ));
   
       register_sidebar(array(
           'name'=>'Top right (social)',
           'id' => 'td-top-right',
           'before_widget' => '',
           'after_widget' => '',
           'before_title' => '',
           'after_title' => '',
       ));
   
       register_sidebar(array(
           'name'=>'Footer 1',
           'id' => 'td-footer-1',
           'before_widget' => '<aside class="widget %2$s">',
           'after_widget' => '</aside>',
           'before_title' => '<div class="block-title"><span>',
           'after_title' => '</span></div>'
       ));
   
       register_sidebar(array(
           'name'=>'Footer 2',
           'id' => 'td-footer-2',
           'before_widget' => '<aside class="widget %2$s">',
           'after_widget' => '</aside>',
           'before_title' => '<div class="block-title"><span>',
           'after_title' => '</span></div>'
       ));
   
       register_sidebar(array(
           'name'=>'Footer 3',
           'id' => 'td-footer-3',
           'before_widget' => '<aside class="widget %2$s">',
           'after_widget' => '</aside>',
           'before_title' => '<div class="block-title"><span>',
           'after_title' => '</span></div>'
       ));
   
       //get our custom dynamic sidebars
       $currentSidebars = td_util::get_option('sidebars');
   
       //if we have user made sidebars, register them in wp
       if (!empty($currentSidebars)) {
           foreach ($currentSidebars as $sidebar) {
               register_sidebar(array(
                   'name'=>$sidebar,
                   'id' => 'td-' . td_util::sidebar_name_to_id($sidebar),
                   'before_widget' => '<aside class="widget %2$s">',
                   'after_widget' => '</aside>',
                   'before_title' => '<div class="block-title"><span>',
                   'after_title' => '</span></div>',
               ));
   
           } //end foreach
       }
       ```
   
 * url: exorbeo.com
 * i’ve read [this](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts-on-this-theme-its-missing-the-id?replies=5)
   and [this](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts-on-this-theme-after-301-302?replies=13)
   posts
 * However, applying id=”%1$s” or ‘<div id=”%1$s” class=”widget %2$s”>’, on the 
   sidebar registers’ before_widget didn’t solve the problem. How should I proceed?
   
   Thanks.
 * btw: ajaxify desatived now so it doesn’t break while I don’t fix it.
 * [https://wordpress.org/plugins/wordpress-popular-posts/](https://wordpress.org/plugins/wordpress-popular-posts/)

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

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts/#post-6315974)
 * Hi there!
 * Are you sure you added the `id="%1$s"` bit in the right place?
 *  Thread Starter [lucascarder](https://wordpress.org/support/users/lucascarder/)
 * (@lucascarder)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts/#post-6316213)
 * Well, I tried adding it to all before_widget and the error message persisted.
 * Some variations I tried:
 *     ```
       //register the default sidebar
       register_sidebar(array(
           'name'=> TD_THEME_NAME . ' default',
           'id' => 'td-default', //the id is used by the importer
           'before_widget' => '<div id="%1$s" class="widget %2$s"><aside class="widget %2$s">',
           'after_widget' => '</aside></div>',
           'before_title' => '<div class="block-title"><span>',
           'after_title' => '</span></div>'
       ));
       ```
   
 *     ```
       'before_widget' => '<aside id="%1$s" class="widget %2$s">',
           'after_widget' => '</aside>',
       ```
   
 *     ```
       register_sidebar(array(
           'name'=>'Top right (social)',
           'id' => 'td-top-right',
           'before_widget' => '<div id="%1$s" class="widget %2$s">',
           'after_widget' => '</div>',
           'before_title' => '',
           'after_title' => '',
       ));
       ```
   
 * The second variation excludes the error message but the widget becomes completely
   blank.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts/#post-6316214)
 * Please enable the _Ajaxify widget_ feature so I can tell you what’s going on.
   Otherwise I won’t be able to help you out.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts/#post-6316244)
 * Since it’s been a week since OP’s last reply, I’m going to assume he managed 
   to figure out what the problem was and so I’m marking this topic as _resolved_.
 * Lucas, if you still need help with this don’t hesitate to ask.

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

The topic ‘Error: cannot ajaxify WordPress Popular Posts’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/error-cannot-ajaxify-wordpress-popular-posts/#post-6316244)
 * Status: resolved