Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Retrieve WordPress root directory path? #9947
    blanknishad-up
    Participant

    Here are the various WorPress solutions get the directory. You can pick anyone as per the need.

     echo "<br/>".get_home_url();     // https://mysiteurl.com
    
     echo "<br/>".ABSPATH;            // /app/
    
     echo "<br/>".get_home_path();    // /app/
    
     echo "<br/>".get_site_url();     // https://mysiteurl.com
    
     echo "<br/>".get_template_directory(); // /app/wp-content/themes/mytheme
    
     echo "<br/>".dirname(__FILE__);  // /app/wp-content/plugins/myplugin/includes
    
     echo "<br/>".get_theme_root();   // /app/wp-content/themes
    
     echo "<br/>".plugin_dir_path( __FILE__ ); // /app/wp-content/plugins/myplugin/includes/
    
     echo "<br/>".getcwd();           // /app/wp-admin
    
Viewing 1 post (of 1 total)