I am new in wordpress, Right now i am working with "my server", and my current domain/main url is like "myurl.com/myproject" And later i will move project(wordpress) to another server and url will be like "myurl.com", so i want to know that right now how can i manage this ? in other words which code should be use for include "css,js,images etc.." ? I tried with following code not showing "http"
echo $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
You can get your domain URL via home_url('/') home_url and get your current directory via PHP function and constant basename(___FILE___) FILE_ basename or use WordPress function to create your desire dircetory path get_template_directory().'/your_dir' get_template_directory or URL get_template_directory_uri().'/your_dir' get_template_directory_uri
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With