SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error message after moving Wordpress to new host

    I'm moving an existing, custom theme, WP site to a new host. I've copied the exisitng site files and database to my localhost on my home/office computer and also into the root of the new account on the new server that the site is going to be moved to.

    Here's the existing site:
    http://www.helitrax.com/

    Here is the copy of the site on my at the new host that we are moving to.
    http://www.helitrax.com.previewdns.com/

    There is that error displayed at the top -Warning: Missing argument 2 for alter_body_class() in /home/content/28/9788328/html/wp-content/themes/helitrax/functions.php on line 37
    class="home page page-id-4 page-template-default logged-in admin-bar with-splash">

    I get the same error viewing it on my localhost at my home/office.

    I have compared the functions.php line 37 from the existing site and from the copies of the new site and it is identical. Lines 36-42 shown below:
    36. add_filter('body_class', 'alter_body_class');
    37. function alter_body_class($classes, $class) {
    38. if (!is_home() && !is_single()) {
    39. $classes[] = 'with-splash';
    40. }
    41. return $classes;
    42. }

    I need to get rid of that error message. I'm not an expert with php and can't figure out why that error is displaying on the copy. I need to resolve it so we can make the site live on the new host. Any help or advice much appreciated.
    Thanks!

  2. #2
    SitePoint Member
    Join Date
    Oct 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Open the wp-config.php file from the root folder
    2. Set the define('WP_DEBUG', true); to define('WP_DEBUG', false);

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply. unfortunately that did not work. The wp-config file did not contain the define('WP_DEBUG', true) line of code. but I tried adding the line define('WP_DEBUG', false); to the file.

    Unfortunately,that did not fix the problem. Thank you for trying to help!

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After searching on the internet a bit this morning I found a clue.

    I edited line 37 from:
    37. function alter_body_class($classes, $class) {

    to read:
    37. function alter_body_class($classes) {


    That has made the error message go away, not sure if it's going to cause any other problems but for now it solves the problem.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •