The MU forums have moved to WordPress.org

Widgetizing themes different in MU? (7 posts)

  1. hempsworth
    Member
    Posted 16 years ago #

    Hi,

    I'm currently working on a theme, and followed the guidelines at automattic.com to make my sidebar widget-ready.

    However, when I try it out on MU they don't work...
    Is it something different in the functions.php file? If so, where can I find this code?

    Thanks,
    Alex

  2. suleiman
    Member
    Posted 16 years ago #

    it's the same code in the functions.php file. What does your specific code say?

  3. hempsworth
    Member
    Posted 16 years ago #

    My functions.php says:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar();
    ?>

    and my sidebar.php says:

    <div id="sidebar">
    		<ul>
    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
     <li>
      <h2>Welcome</h2>
      Please enable some widgets
    
     </li>
    <?php endif; ?>
    </ul>
    	</div><!-- ends #sidebar -->

    The sidebar options page isn't showing up in the admin panel.

  4. ceejayoz
    Member
    Posted 16 years ago #

    Try doing this in functions.php:

    
    <?php
    if ( function_exists('register_sidebar') ) {
        register_sidebar();
        echo "THIS IS JUST A TEST.";
    }
    ?>
    

    If "THIS IS JUST A TEST." doesn't show up anywhere, the Widgets plugin isn't installed properly.

  5. hempsworth
    Member
    Posted 16 years ago #

    It doesn't show up...
    Is the sidebar.php code okay, because I'm running a fresh intall of WPMU. The widgets plugin doesn't need to be installed does it?

  6. ceejayoz
    Member
    Posted 16 years ago #

    The widgets plugin doesn't need to be installed does it?

    That's probably your problem. :-p

    Yes, it needs to be installed. Drop

    widgets.php
    from the Widgets plugin zip file into your
    wp-content/mu-plugins
    folder and they'll be enabled for all users.

  7. hempsworth
    Member
    Posted 16 years ago #

    Haha, what an idiot! I though widgets were installed out of the box.

    Cheers!

About this Topic

  • Started 16 years ago by hempsworth
  • Latest reply from hempsworth