Support » Fixing WordPress » Relative links and Widgets problems on XAMPP setup

  • I have spent most of today trying to set up a copy of my blog locally to play around with. Following the instructions graciously provided on Podz’ site was simple enough, but goodness, it’s taken a lot of detail work to get it close to working.

    One real hassle has been the fact that none of my relative links seemed to work on the new setup, so I had to convert most every href and src address in my various template files. That’s done now, and mostly working, with just a few stray links (like the “Next” button at the bottom of my main pages) still refusing to work. But the usefulness of doing theme tinkering locally is diminished if I’ll have to go changing everything back over again to implement any changes on my site. Is this problem possibly fixable, or just something I have to live with if using XAMPP?

    The other problem is that the blog dies violently if I try turning Widgets on. With them activated (as they are on my live site, working just fine) my header appears on the main page, but then only the following underneath it, where the rest of the blog should be:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\…\wp-content\plugins\widgets\widgets.php on line 307

    Fatal error: Cannot use string offset as an array in C:\…\wp-content\plugins\widgets\widgets.php on line 1482

    Line 307 of widgets.php is

    $params = array_merge(array($sidebar), $registered_widgets[$name][‘params’]);

    and line 1482 is

    $title = $options[$number][‘title’];

    I’m stumped. Anyone have an idea of what’s going on here?

    P.S. I tried using the version of widgets.php posted at http://betzster.no-ip.org/Blog/index.php/2006/04/03/sidebar-widgets-plugin-iis-fix/ but it returned the same errors related to the same lines of code; they just had different numbers (155 and 773 instead of 307 and 1482).

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    At the top of your theme’s functions.php file, there should be a line similar to this:
    if ( function_exists('register_sidebars') )
    register_sidebars(1);

    At the top of your sidebar.php file (or somewhere else in your theme), there will be something similar to this:
    <?php if ( function_exists('dynamic_sidebar')
    && dynamic_sidebar(1) ) : else : ?>

    What are those lines in your actual theme? Most likely, one or both of them is incorrect.

    Thread Starter kevintmc

    (@kevintmc)

    Thanks for the reply.

    Those lines appeared just as you specified…except there was no numeral 1 inside either of the parentheses where they appeared in your example. I tried adding them, and it improved things slightly.

    Now my main page is no longer entirely broken with Widgets activated; but the sidebar still looks the same as it did when Widgets was turned off (and the Widgets part of the admin controls does not work). And appearing above every page now, including the admin pages, is the following:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\…\wp-content\plugins\widgets\widgets.php on line 115

    Which is exactly the same as the non-fatal part of the error message before, only now citing a different line.

    Line 115 (or line 58 in the alternate version of widgets.php I referred to, which returns the same error) is:

    $sidebar = array_merge($defaults, $args);

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Those lines appeared just as you specified…except there was no numeral 1 inside either of the parentheses where they appeared in your example. I tried adding them, and it improved things slightly.

    Neither of those 1’s is a required parameter, so that shouldn’t make any difference. If defaults to “1” in that case anyway.

    (and the Widgets part of the admin controls does not work)

    What’s this? You didn’t mention this before. Is the Sidebar Widgets page actually accessible under the Presentation menu? If so, what “doesn’t work” about it?

    When you installed the widgets plugin, did you remember to copy the “scriptaculous” directory to /wp-includes/js/scriptaculous? This is a commonplace problem that can cause this sort of thing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Relative links and Widgets problems on XAMPP setup’ is closed to new replies.