You need to check if the siteurl differs from the home URL:
if ( get_option( 'siteurl' ) !== get_option( 'home' ) ) { // whatever
This also works if home is a subdirectory of the root, with WordPress installed in yet another subdirectory. For example: domain.com/blog (URL) and domain.com/blog/wordpress (siteurl).
Related Posts:
- How to point my domain to a WordPress install in a sub-directory?
- Multiple domains for multiple single installs
- Sub-domain or 2nd, temporary different domain?
- Second wordpress installation on subdirectory
- Change multi-site installation from sub-domains to sub-directories
- Can I install a new WordPress site inside a sub-directory of an existing WordPress site?
- Subdomain redirects to subdirectory [closed]
- 2 WordPress sites in 2 sibling folders on one domain
- After changing wp from subdirectory to root I can’t preview any changes to a page or post
- Installed WordPress Location
- Should I install blog on subdomain or subdirectory?
- google xml sitemap won’t work on directory install
- How can i shift my chosen posts to a subdirectory?
- WordPress not handling subdirectory properly
- Does WordPress refer to any files outside of the main install folder (and database)?
- Run two wordpress on the same domain
- wordpress sub-directory sites on a sub-domain?
- Trying to setup a dev subdomain, but url loads as /dev/ instead
- Moving from subdirectory and subdomain -> root
- How to move a WordPress installation to a subdirectory
- WordPress page for one specific page on Google Cloud hosted website?
- How to Install WP to Subdomain but Serve on Subdirectory?
- How to replace a wordpress installation in root directory with another in a subdirectory?
- Index (Home) page not displayed when running wordpress in a subdirectory
- The right way to go about creating a WordPress site from a static site which has WordPress installs in its subdirectory
- Multisite Sub-directories Installation
- Compare 2 directories in windows
- Change upload directory for PDF files
- What’s the purpose of index.php in wp-content directory? [duplicate]
- How to use alias domain for multisite installation?
- How do I serve static content on same domain as WordPress
- WordPress Multisite. Can domain be used instead of subdomain?
- Multisite: differences between subdomain and subdirectory mode? Can it be switch after installation?
- NGinx + WordPress Subdomain Multi with core in Subdirectory
- WordPress within a subdirectory of another WordPress environment doesn’t work
- Disable to create folders for every years and months in uploads folder
- local folder permissions vs chown — security considerations
- How can i run the same WordPress install on multiple subdomains?
- How is a student directory best handled in WordPress?
- Creating directory in uploads: mkdir vs wp_mkdir_p
- Include file from higher level
- Is it good security advice to install wordpress in subdirectory but link to root?
- wordpress blog in subdirectory or subdomain
- How to run a subdirectory multisite install under a subdomain
- Accessing WordPress installation in its own directory at domain root
- Is there any way to allow a plugin to write over a previous version?
- How to retrieve TLD domain for the current website?
- Template Hierarchy tag-{slug}.php directory
- more than one upload directory?
- WordPress installed in root, need second in subdirectory with different domain
- How to make use of WP templates within a nested site structure?
- Plugins will only be installed with 777 on folder. Solution?
- How to create directory using username within theme
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- Main WP page and subfolder WP with the same name. How to prioritize for main Wp
- One Domain, Two Installs of WordPress
- Two WordPress installations: One in root and one in sub directory – no images in subdir installation [closed]
- Moved WordPress site to new server, directory permissions not working correctly
- Is it possible to install WordPress Multisite on a subdomain with subdirectories?
- Moving WP from /blog to root directory
- Hosting my WordPress site out of a subdirectory
- Moving WordPress from Root to a subfolder
- Subdomain to website directory blog transferring
- Install multisite wordpress on a subdomain and map to top level domains
- Path in dev server works; same path in prod server is broken
- What is wp-admin/meta for?
- Multisite – One Site with multiple URLs
- What plugins create a directory on the root directory of WordPress? [closed]
- Access sub-domain when root public_html is protected with .htaccess password
- How to disable directory files from accessing?
- Automatically generator a WordPress installation on my subdomain
- How to visit php file in my custom directory under site root directory
- Getting Internal server in sub folder pages
- Multisite for main in subdirectory, subdomain and subfolders (EN/ES)
- Powering only a subfolder with WordPress on a LAMP stack with an nginx reverse proxy
- Can’t login to WordPress admin panel after changing domain to use WordPress pages as a fallback from React
- multisite installed on subdomain now want another subsite on subdirectory
- After switch domain, some parts of my site still point to my old domain
- How to install WordPress on sub directory in ubuntu 16.4 in same vhost with AngularJS
- Bedrock WordPress retro-porting to standard WP installation: is this allowed?
- Permalink issue with WordPress Site at domain root and another WordPress Site in a Subfolder
- Change the WordPress files structure
- Problems with running a 2nd installation of WordPress on my domain?
- Question of the subdomain
- Downloadable content file structure
- WordPress makes 404 error when going to domain folder
- Using same root header in subfolder wp blog – Header disapears on Single Posts
- Run multiple installs using the same wp-admin & wp-includes?
- WordPress on Azure as Subdirectory
- Multisite, different domains, optional subdirectory, and htaccess
- Move WordPress with changed name ‘wp-content’
- Domain name to a page
- FTPS Uploads – wp-content cannot be found
- Serve HTTPS requests from subdomain
- Hide/Remove Wp Directory /wp-content/uploads/
- I have a question about the name of my blog [closed]
- Multi site root site installed on subdomain, with child sites as subdirectories
- WordPress multisite with subdomains behind nginx reverse proxy using subdirectories
- unabled to link all the pages
- WordPress: How to change name of ADD-ON domain’s folder and also change/rename all references to it