WordPress.org

Ready to get started?Download WordPress

Forums

WordPress URL change home page not displaying (5 posts)

  1. Oizuled
    Member
    Posted 7 months ago #

    I am trying to move a WordPress from one server to another, and have the URL point to the new server. Currently I have a copy of the site on both the old server and new server, however the URL still points to the old server.

    I want to test to make sure that the site works on the new server before I make any DNS changes though.

    On the new server, I edited the current theme's functions.php file and included the following lines immediately after the opening <?php so that it points to the temporary http://IP/~username

    update_option('siteurl','http://192.185.4.156/~cthm');
    update_option('home','http://192.185.4.156/~cthm');

    Old Server - http://cttreesofhonor.org/
    New Server - http://192.185.4.156/~cthm/

    If you click on the old server link, the site looks exactly how it should. If you click on the new server link, everything looks exactly how it should except for the home page. All the other pages display just fine.

    I can't figure out why the new server doesn't display the home page correctly, but all the other pages seem to display just fine?

  2. JumboClicks
    Member
    Posted 7 months ago #

    make sure your options settings reading

    has the correct setting .. for a static page or for a loop of your first posts.

    also some themes use a home.php file in the theme directory to show the home page .. check if that is a problem

  3. Oizuled
    Member
    Posted 7 months ago #

    The Settings > Reading page has the correct settings - I have the two dashboards open side by side and all the settings are the same there.

    The homepage uses it's own template page, but I copied that from the original site as well - the templates on the two servers are identical.

    I even tried to change the template used on the home page to the template that appears to work correctly on the other pages - it still doesn't display the content. And yes, the page set to be the home page does have content in it on the edit page - identical to what is on the original site.

    Also another thing I just noticed is that the WP admin bar that shows up at the top of the screen when logged in doesn't appear when I'm on the home page, but it does appear on the other pages. And by saying that the WP admin bar "doesn't appear", I mean that the <div id="wpadminbar" class="" role="navigation">...</div> doesn't even load to the home page when I view the source.

  4. benfreke
    Member
    Posted 7 months ago #

    Hi

    Your server has encountered an error, and stopped processing code. If you view the source, you can see that the last line of html is

    <div class="content_full_width">

    You will need to look at your error log, or enable WP_DEBUG in your config to get more information. There is something different in the server configuration of those two servers that is causing the issue.

    Is the video that is on the homepage part of the content, and using the default wordpress embed code?

  5. Oizuled
    Member
    Posted 7 months ago #

    With WP_DEBUG enabled, it looks like there is something going on with the theme's functions.php and the WP image editor:

    functions.php issue
    Use of undefined constant E_DEPRECATED - assumed 'E_DEPRECATED'...in functions.php

    Fixed this by changing this line:
    error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_WARNING & ~ E_DEPRECATED & ~ E_USER_NOTICE);

    to

    if(defined('E_DEPRECATED')) {
    			error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_WARNING & ~ E_DEPRECATED & ~ E_USER_NOTICE);
    		} else {
    			error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_WARNING & ~ E_USER_NOTICE);
    		}

    WP Image Editor Issue

    Catchable fatal error: Object of class WP_Error could not be converted to string...

    The chunk of code it is referring to in my site's theme is below:

    //function check for WordPress 3.5 wp_get_image_editor
    		if(function_exists('wp_get_image_editor')){
    		$new_img_path = tt_resize_image( $file_path, $width, $height, $crop );
    		}else{
    		$new_img_path = image_resize( $file_path, $width, $height, $crop );
    		}
    
    		$new_img_size = getimagesize( $new_img_path ); //error refers to this line
    		$new_img = str_replace( basename( $image_src[0] ), basename( $new_img_path ), $image_src[0] );

    I got the error resolved by changing the URL in a shortcode that displays an image on the homepage. It previously was pointing to the URL on the old server rather than the IP on the new server.

    It doesn't display the images like it is supposed to, but the page at least loads - I can always replace the shortcode with a direct link to the image.

Reply

You must log in to post.

About this Topic

Tags