• Resolved luarb

    (@luarb)


    Hello ,

    I’m trying to make 2 wordpress sites use the same database ,
    i tried working on the prefix but there is nothing i can do to
    about the Site Url and Home fields on Wp-option table ,
    so i thought , if i put them inside the code when they get called ,
    they wont have to query the table to get the urls ,
    but i dont know where they are located
    can anyone help ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Try the filters ‘pre_option_siteurl’ and ‘pre_option_home’. Whatever your callback returns will be seen as the value for siteurl and home regardless of what is actually in the DB.

    Be aware that burying these values in code could drive some poor admin crazy somewhere down the line when they cannot move the site to a different server no matter what they enter in settings — including yourself if you forget this was done!!

    Thread Starter luarb

    (@luarb)

    lol! no problem man im the admin and thanks for the advice .
    Would you please show me an example where can
    i do this ?

    Thread Starter luarb

    (@luarb)

    I found something that worked like a charm,

    i added this lines on wp-config.php :

    $homewp=’https://www.site.com’;
    $locationwp=’https://www.site.com’;
    define(‘WP_HOME’,$homewp);
    define(‘WP_SITEURL’,$locationwp);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Embed Site URL and Home inside the code.’ is closed to new replies.