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

0
No products in the cart.
  • This topic is empty.
Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #9941
    mike-ciffone
    Participant

    Why was this made so complicated? One command:

    Nginx

    grep -i 'root' /etc/nginx/sites-enabled/*

    Apache

    grep -i 'DocumentRoot' /etc/apache2/sites-enabled/*

    #9947
    nishad-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 2 posts - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.