WordPress.org

Ready to get started?Download WordPress

Forums

How to have wordpress back to up and running (34 posts)

  1. massy74
    Member
    Posted 10 months ago #

    Hi

    By mistake, I changed wordpress URL and domain in general settings from http://www.mydomain.com/wordpress to http://www.mydomain.com . Now I cannot have access to my admin and login page any more. I tried to change functions.php in my theme folder and wp-config as some posts say but nothing worked out. Is there a solution to have my wordpress back to up and running? If not, can I recover the pages at least and install a new version of wordpress since I am using not the latest one?

    Please help.
    Thanks
    Max

  2. Media X
    Member
    Posted 10 months ago #

    Did you enter this in your wp-config:

    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');

    The instructions can be found here.

  3. massy74
    Member
    Posted 10 months ago #

    Yes I did - but the pos does not say where I should put these lines into the wp-config file.

    Please advice.

  4. Media X
    Member
    Posted 10 months ago #

    You can add it at the beginning of the file:

    <?php
    
    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');
    
    /**
     * The base configurations of the WordPress.
    ........
  5. Zakir Sajib
    Member
    Posted 10 months ago #

    I would suggest following code which is more error prone

    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
  6. massy74
    Member
    Posted 10 months ago #

    I tried as you suggested but the page cannot be found.

  7. You really want to give this a try again.

    http://codex.wordpress.org/Changing_The_Site_URL#Edit_functions.php

    Using the define is only a temporary work around.

  8. massy74
    Member
    Posted 10 months ago #

    Hi

    As per my post, I did already try to change function.php but it did not work.

  9. Can you provide a link to your site?

  10. massy74
    Member
    Posted 10 months ago #

    Can it make any difference? I think without the credetial login details you cannot do too much...

    I think the best option would be to reinstall wordpress. Right? Will I lose the pages? They should be in database so they are not going to be lost I guess.

  11. Zakir Sajib
    Member
    Posted 10 months ago #

    don't reinstall.
    Clear browser cache.

    You are doing something wrong or you are not following the guidelines :)

  12. Can it make any difference? I think without the credetial login details you cannot do too much...

    Yes. For one it can help us determine the path your theme and theme's functions.php file.

    Editing the functions.php file always works but it has to be ran for it to work.

    If that does not work then there's always the option of manually updating your settings in the mysql database.

    http://codex.wordpress.org/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database

    Which is a little more trickier but if done carefully and successfully also does work.

  13. massy74
    Member
    Posted 10 months ago #

    I don't know how to access to phpMyadmin to editing the database. Any other way around? I ask the question again: How about if I reinstal wordpress?

    Thanks
    M

  14. massy74
    Member
    Posted 10 months ago #

    Sorry - I did not read the message from Zakir. So I shall clear the cache...and try to edit either functions.php or wp-config..right?

  15. massy74
    Member
    Posted 10 months ago #

    I did it again - plus I cleared the cache first. It does not work.

  16. esmi
    Forum Moderator
    Posted 10 months ago #

    Use the functions.php method as Jan suggested.

  17. massy74
    Member
    Posted 10 months ago #

    I did it several times and it does not work

  18. massy74
    Member
    Posted 10 months ago #

    Obviously I assume that you guys mean fuctions.php of my active theme. Right? If so, as above, I did not work.

  19. esmi
    Forum Moderator
    Posted 10 months ago #

    I assume that you guys mean fuctions.php of my active theme.

    Yes

    If so, as above, I did not work.

    Did you try to re-load the site as suggested?

  20. massy74
    Member
    Posted 10 months ago #

    What do you mean by re-load the site?

  21. massy74
    Member
    Posted 10 months ago #

    If you meant to access to my database then I don't know how to do it.

  22. esmi
    Forum Moderator
    Posted 10 months ago #

    Did you try to navigate the the front page of your site as suggested in the instructions suggested by Jan above?

  23. massy74
    Member
    Posted 10 months ago #

    Yes I did - It is a mess. How can that page help me?

  24. esmi
    Forum Moderator
    Posted 10 months ago #

    If you follow the instructions carefully & correctly, it will work.

  25. massy74
    Member
    Posted 10 months ago #

    I cannot see Jan's instruction. He suggested to access to my database which is something that I don't know how to do it. Would you be so kind as to list the instructions you are referring to?

  26. esmi
    Forum Moderator
    Posted 10 months ago #

    No - he suggested that you use the functions.php method.

  27. massy74
    Member
    Posted 10 months ago #

    As said several times, I tried the fuctions.php method and it does not work

  28. esmi
    Forum Moderator
    Posted 10 months ago #

    It's worked for thousands of other people...

  29. massy74
    Member
    Posted 10 months ago #

    OK - I did the following:
    - By FTP, I went to the theme directory and downloaded functions.php.
    - I add the lines(Of course my web site replace example) as below:

    <?php
    update_option('siteurl','http://example.com');
    update_option('home','http://example.com');
    
    //	Registers the Widgets and Sidebars for the site
    function skt_widgets_init() {
    	register_sidebar(array(
    		'name' => 'blog-sidebar-area',
    		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	));
    	register_sidebar(array(
    		'name' => 'footer-first-sidebar-area',
    		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	));
    	register_sidebar(array(
    		'name' => 'footer-second-sidebar-area',
    		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	));
    	register_sidebar(array(
    		'name' => 'footer-third-sidebar-area',
    		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	));
    }
    add_action( 'widgets_init', 'skt_widgets_init' );
    
    /***************register nav menus*********************/
    register_nav_menus( array(
    	'Header' => __( 'Primary Navigation','analytical'),
    ));
    
    /***** Make theme available for translation ****/
    // Translations can be filed in the /lang/ directory
    
    function skt_lang_setup(){
    	load_theme_textdomain('analytical', get_template_directory_uri() . '/languages');
    }
    add_action('after_setup_theme', 'skt_lang_setup');
    
    /*  * Loads the Options Panel * * If you're loading from a child theme use stylesheet_directory * instead of template_directory */
    if ( !function_exists( 'optionsframework_init' ) ){
    	//Theme Shortname
    	$shortname = 'analytical-lite';
    	$themename='Analytical Lite Theme';
    	define( 'OPTIONS_FRAMEWORK_DIRECTORY',get_template_directory_uri() . '/SketchBoard/includes/' );
    	require_once get_template_directory() . '/SketchBoard/includes/options-framework.php';
    	require_once get_template_directory() . '/SketchBoard/functions/admin-init.php';
    }

    - I saved it as functions.php by using a note pad.
    - I deleted fuctions.php from the theme directory and upload the amended fuctions.php by FTP.
    - I browsed http://www.example.com/wordpress/wp-admin and http://www.example.com/wordpress/wp-login but the page cannot be found.

    What am I doing wrong?

  30. esmi
    Forum Moderator
    Posted 10 months ago #

    Site url?

Reply »

You must log in to post.

About this Topic

Tags

No tags yet.