• Resolved [email protected]

    (@terriswiatekyahoocom)


    Hi,
    I changed a sites URL in the General/Settings menu and now want to change it back. I’ve done so successfully using the wp-config.php file as described in the codex instructions here https://codex.www.ads-software.com/Changing_The_Site_URL

    However, it states this is not the best method. So I am trying to edit it via the functions.php file.

    I have ftp access and am adding the code as described in the example but replacing with my domain.

    <?php
    update_option('siteurl','https://www.eaofwny.com/livingbuffalo');
    update_option('home','https://www.eaofwny.com/livingbuffalo');
    
    Rest of my funtions.php code here
    ?>

    Then I re-upload in the same ftp location. However, then I get this error displayed and no site.

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘&’ or T_VARIABLE in /home/content/62/10551762/html/livingbuffalo/wp-includes/functions.php on line 2

    I think I am adding it in the correct location according to the codex instructions but perhaps the code is incorrect? Any help is appreciated thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • code looks ok.. are you sure there are no typos anywhere? check first line <?php as well. how did you edit the file? as in, is file-encoding ASCI?
    heres something you can do,
    create a fresh file for functions.php and place your 2 liner code within. now take a backup of your original file, and upload new one.
    reload your webpage multiple times so the URLs are reset.
    then upload back your original functions.php file.

    Moderator keesiemeijer

    (@keesiemeijer)

    Did you put the code in the functions.php file in the includes folder?
    /livingbuffalo/wp-includes/functions.php

    If so, you need to remove those lines from there and put it in your theme’s functions.php file
    /livingbuffalo/wp-content/themes/yourtheme/functions.php

    lolz.. this forum teaches me to see things in a different perspective. who would have thought.. ??

    Thread Starter [email protected]

    (@terriswiatekyahoocom)

    That was the issue keesiemeijer, thanks.
    Seems to working just dandy now.

    shadez, I imagine you’re making lol’ing at my ignorance of mistaking one functions.php file for a functions.php file in another directory?

    nope.. being a techie myself, was thinking of how i thought it to be a technical difficulty related to encoding, syntax, file processing, etc while the issue was with something more ‘simpler’. hope you get it..
    merry xmas!

    Moderator keesiemeijer

    (@keesiemeijer)

    @terri.swiatek

    I’m glad you’ve got it resolved. Now that it’s working you can remove the lines from your theme’s functions.php file.

    https://codex.www.ads-software.com/Changing_The_Site_URL#Edit_functions.php

    For what it’s worth, I didn’t get the impression shadez made fun of your mistake. Sometimes you overlook a simple thing and try to solve it with difficult solutions. The more eyes on a problem the sooner it gets solved. He/she praised the forum for that.

    Thread Starter [email protected]

    (@terriswiatekyahoocom)

    Ah yes, I’m happy it was an easy fix. Merry Christmas to you too shadez.

    Did so and still working great, thanks again for your help keesiemeijer.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Changing site URL via functions.php’ is closed to new replies.