Setting up WordPress

June 14, 2007 | By | 6 Replies More
  1. When trying to install the Independence Day theme, the following error message appeared: Warning: array_merge() [function array_merge]: Argument 2 is not an array in: …/wp-includes/widgets.php on line 53. Based on the comments on this post:
    I changed line 53 of wp-includes/widgets.php to:
    $sidebar = array_merge($defaults, (array)$args);
    The change casts argument 2 to the array type, and seems to work fine.
  2. I have multiple links categories (Blogroll, Clock History Links, etc) and my pages would not pass XHTML validation, due to repeated use of an id by the widget code. The WordPress forum gave the following fix: Insert the following line of code as the first statement after the else { on line 360 of wp-includes/widgets.php:
    $before_widget = preg_replace('/id="[^"]*"/','id="%id"', $before_widget);

The above applies to WordPress version 2.2.

A side note: Dreameaver MX was adding multiple attributes such as mmTranslatedValueHiliteColor=”HILITECOLOR=%22Dyn%20Untranslated%20Color%22″ to the page, so I used jEdit instead for editing, and used Dreamweaver only for site management such as uploading files. I can’t explain why Dreamweaver is messing things up, I have the preferences set for it not to do code rewriting.

Another problem I had (never solved) with Dreamweaver MX editing php files was that in some cases it was replacing a require_once statement withe contents of the included file! I hope to try the latest version of Dreamweaver later this year and see if it is fixed.

Share this post:


Category: WordPress

Last updated: July 9, 2007

Comments (6)

Trackback URL | Comments RSS Feed

  1. Bill says:

    For WordPress 2.3.2, fix 1 is the same.

    For fix 2, add the lines shown in the post after line 399 of widgets.php

  2. Admin says:

    For WordPress 2.3, fix 1 is the same.

    Fir fix 2, add the line:

    $before_widget = preg_replace(’/id=”[^”]*”/’,’id=”%id”‘, $before_widget);

    after these two lines:

    function wp_widget_links($args) {
    extract($args, EXTR_SKIP);

    (after line 399).

  3. Admin says:

    I was getting errors such as:

    Warning: Cannot modify header information – headers already sent by (output started at /home/bcwstodd/public_html/clockinfo/wp-config.php:47) in /home/bcwstodd/public_html/clockinfo/wp-includes/pluggable.php on line 331

    after upgrading to WP 2.2.2. The problem was a space after the PHP closing tag in wp-config.php. The closing tag needs to be the last thing in the file (no spaces after it).

  4. Admin says:

    For WP version 2.2.2, insert the line:

    $before_widget = preg_replace(‘/id=”[^”]*”/’,’id=”%id”‘, $before_widget);

    after the else { on line 396 of widgets.php.

    Fix 1 above should also be made for version 2.2.2

  5. Admin says:

    One more change I made to the Independence Day theme. An ordered list was being displayed with bullets, and an unordered list was being displayed with numbers; so I swapped the definitions for .post ul li and .post ol li in style.css

Leave a Reply