We help IT Professionals succeed at work.

Wordpress 3.2.1 Widgets will not move to side bar

dmullis
dmullis used Ask the Experts™
on
I've created all the php for my custom wordpress theme , but when I go into the appearance sidebar add widget. The widgets will not move. I am using  wordpress version 3.2.1.

This is my sidebar code.

<div class="sidebar">
 
 <?php if ( !function_exists('dynamic_sidebar')
       || !dynamic_sidebar() ) : ?>
  <ul>
    <li id="search">
      <?php include(TEMPLATEPATH . '/searchform.php'); ?>
    </li>
    <li>
      <h2>
        <?php _e('Archives'); ?>
      </h2>
      <ul>
       <?php wp_get_archives('type=weekly'); ?>
      </ul>
    </li>
 
      
    <li>
      <h2>
        <?php _e('Categories'); ?>
      </h2>
      <ul>
        <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
      </ul>
    </li>
   
    <?php get_links_list(); ?>
    <li>
      <h2>
        <?php _e('Meta'); ?>
      </h2>
      <ul>
        <?php wp_register(); ?>
        <li>
          <?php wp_loginout(); ?>
        </li>
        <?php wp_meta(); ?>
      </ul>
    </li>
  </ul>
</div>

please advise why my widgets will not move to the sidebar.
<div class="sidebar"> 
 
 <?php if ( !function_exists('dynamic_sidebar')
       || !dynamic_sidebar() ) : ?>
  <ul> 
    <li id="search"> 
      <?php include(TEMPLATEPATH . '/searchform.php'); ?> 
    </li> 
    <li> 
      <h2>
        <?php _e('Archives'); ?>
      </h2> 
      <ul> 
       <?php wp_get_archives('type=weekly'); ?> 
      </ul> 
    </li> 
  
	 
    <li> 
      <h2> 
        <?php _e('Categories'); ?> 
      </h2> 
      <ul> 
        <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?> 
      </ul> 
    </li> 
   
    <?php get_links_list(); ?> 
    <li> 
      <h2> 
        <?php _e('Meta'); ?> 
      </h2> 
      <ul> 
        <?php wp_register(); ?> 
        <li> 
          <?php wp_loginout(); ?> 
        </li> 
        <?php wp_meta(); ?> 
      </ul> 
    </li> 
  </ul> 
</div>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You were missing the   <?php endif; ?> code after the dynamic sidebar call. Here is the corrected code:
<div class="sidebar"> 
<?php if ( !function_exists('dynamic_sidebar')
     || !dynamic_sidebar() ) : ?>
<?php endif; ?>
<ul> 
  <li id="search"> 
    <?php include(TEMPLATEPATH . '/searchform.php'); ?> 
  </li> 
  <li> 
    <h2>
      <?php _e('Archives'); ?>
    </h2> 
    <ul> 
     <?php wp_get_archives('type=weekly'); ?> 
    </ul> 
  </li> 
  <li> 
    <h2> 
      <?php _e('Categories'); ?> 
    </h2> 
    <ul> 
      <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?> 
    </ul> 
  </li> 
  <?php get_links_list(); ?> 
  <li> 
    <h2> 
      <?php _e('Meta'); ?> 
    </h2> 
    <ul> 
      <?php wp_register(); ?> 
      <li> 
        <?php wp_loginout(); ?> 
      </li> 
      <?php wp_meta(); ?> 
    </ul> 
  </li> 
</ul> 
</div>

Open in new window

Author

Commented:
Still same problem. Widgets will not budge. I get the 4 pointed arrow but none will move to the side bar.
Try using a different browser, or dragging them and holding them over the area for a few seconds.

Author

Commented:
Cannot get them to drag in FF or IE.
If you switch your theme to TwentyTen or TwentyEleven, does it work then?

Another thing you can try is going to Dashboard>Updates, then select re-install anyway (if your version is already up to date). Sometimes when you update WordPress some files don't install correctly and this might fix the issue.

If none of the above works, try disabling your plug-ins. If this does it then you have a plug-in that isn't registering JavaScript correctly.

Author

Commented:
I can't get any of the other themes to move widgets either. I've done this before. Nothing budging now.

Author

Commented:
I'll try the update. I don't have any plugins yet.

Author

Commented:
I re-installed the update and I am using the TwentyTen 1.2 theme now.one of the widgets will move over. weird? I am on my local pc using wamp. Other things seem to work.
Try turning debug on to see if it gives any clues to the error. To turn it on open your wp-config.php file located in in your WordPress root folder.

Look for this:

define('WP_DEBUG', false);


and change it to this:

define('WP_DEBUG', true);

Do you have firebug installed on FF? If not install the plug-in and see if it gives any errors.

Author

Commented:
I installed Firebug on Firefox and changed the  config file to debug true. I am not sure how to test it other than go to the web page?

Author

Commented:
this is weird though, in the search box on the blog - it had some </br> code in it so I deleted it and actually tried a search and in cam back with this error: Not Found

The requested URL /SlimShow/<br /><b>Notice</b>: get_bloginfo was called with an argument that is <strong>deprecated</strong> since version 2.2! The <code>home</code> option is deprecated for the family of <code>bloginfo()</code> functions. Use the <code>url</code> option instead. in <b>C:\wamp\www\SlimShow\wp-includes\functions.php</b> on line <b>3466</b><br />http://localhost/SlimShow/ was not found on this server.

I have validated each php file and the style.css and there are no errors.

Commented:
It sounds like a javascript conflict to me.

If it still doesn't work with all your plugins disabled then maybe you have some custom javascript loading from the site.  If you track it down you can wrap it in  if ( ! is_admin() ) { } to only load on non-admin pages.
I'm just curious. How did you validate your php files?

Are you using an IDE to validate the PHP? Either way, they don't recognize all WordPress code, so while it may validate as PHP, it doesn't mean it's valid for WordPress.

You definately have an error in your code. I would say it's in your functions.php file. If you upload the code, I'll take a look at it.

Author

Commented:
Awesome Jeremyjared74 ! I did get to see the debugger in action.


There were about 4. The last 2  messages were:

Notice: wp_list_cats is deprecated since version 2.1! Use wp_list_categories() instead.

Notice: get_links_list is deprecated since version 2.1! Use wp_list_bookmarks() instead. in 3382

 The real issue was I used an older wordpress/php tutorial to create my files.

So yes you were absolutely right on target! Issue resolved! Thankyou Sir :)

Author

Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for dmullis's comment http:/Q_27243136.html#36326198

for the following reason:

Excellent Problem solver!

Author

Commented:
The question is NOTsupposed to be closed. Jeremyjared74's solution was accepted in full and excellent job of solving the problem. Please award him the 500 points.

Author

Commented:
Excellent problem solving skills. On target!
Thanks dmullis:

I'm glad you picked up some new tools for troubleshooting. Firebug is a must have for me.