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
- How to share cookies and sessions between domain and subdomain?
- How to use alias domain for multisite installation?
- Installation problems on a domain-name-less server
- Benefits or Problems for using Sub-Directory vs Sub-Domain install of WP Network
- Multisite: differences between subdomain and subdirectory mode? Can it be switch after installation?
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- NGinx + WordPress Subdomain Multi with core in Subdirectory
- WordPress within a subdirectory of another WordPress environment doesn’t work
- How to create new folder in wp-content root same like upload folder?
- issues including a file from a plugin directory
- How do I use different domain for subdomains in WP Multisite?
- Creating directory in uploads: mkdir vs wp_mkdir_p
- Cant get wordpress to work on subdirectory
- How to create an Online Dictionary Using WordPress? [closed]
- Include file from higher level
- Moving to directory creates path problems.. how to solve?
- WP Multisite – domain mapping to domain.com and separate site to domain.com/help
- wordpress blog in subdirectory or subdomain
- How to run a subdirectory multisite install under a subdomain
- How to retrieve TLD domain for the current website?
- Template Hierarchy tag-{slug}.php directory
- WP install in sub-dir white screen
- Change directory of javascript files
- Theme in wp-content but my index.php search theme files in root
- get_query_var not working for subdirectory
- Multiple wordpress installations that shares WordPress & Theme but with separated database
- How can I have nginx serve WordPress at /blog?
- How to make use of WP templates within a nested site structure?
- Prevent WordPress from interpreting a subfolder?
- Plugins will only be installed with 777 on folder. Solution?
- How to create directory using username within theme
- How to run WordPress from other location on the same domain
- multisite subdomain behind reverse proxy
- Multisite – Looking for ideas to best manage a main site change
- Multisite Subdirectory with same domain subdomain
- Session Expired when WordPress Address (URL) and Site Address (URL) are different
- How to use different domains for different blogs hosted in the same host in subdomains with .htaccess
- Folder keeps popping up in my public_html directory and overriding WordPress page structure
- Installing wordpress on a subdomain of an already existing static website
- Creating a copy of a website in a subdirectory, wp-admin redirect problem
- How to redirect the frontend of a WordPress site (only)?
- Moving WordPress from Root to a subfolder
- Clean installation missing its /wp-content folder
- Where to put robot.txt and sitemap.xml for wordpress installed in its own directory
- Multisite on single wordpress
- Automating WP application directory creation (domain name passed as a variable argument)
- Move WordPress from Root to Subfolder
- Impossible to index an upload folder with 10k files
- Relative Root Url For Sub domain name
- WordPress in a Subdirectory
- Moving wordpress from /dir to main folder
- Giving WordPress Its Own Directory together with index.html
- Upload an image at frontend > Create direction and/or rename filename possible?
- Is there a way to create folders restricted to specific users to open?
- WordPress hosted on subfolder of domain causing customizer to constantly refresh and is requesting jquery from root domain
- Error in the paths of one of the plugins when changing the plugin directory
- Serve WordPress site as root domain with WordPress files in subdirectory in nginx server
- I need advice for creating native WordPress directory site based on native WordPress functionality only
- How Do I Redirect a WordPress Website?
- Rrestrict access to static pages if user is not logged in
- How can I move the subdomain to the root domain?
- Multisite has SSL certificate, but media library is still http://
- new WPMS site not working / Q setting up new site/subdomain
- Do I need to be selective about where I search and replace when pointing a domain to a subfolder used for development?
- Sub-directory domain on subdomain multisite?
- WordPress Multisite subdomains and sharing the same upload folder
- Create Subfolder that always displays template file
- Subdirectory and domain multisite installation
- Installed in root, want second in subdirectory
- How to create short urls for sharing and downloadable content?
- Install wordpress as a development site in a subdirectory on live server
- Plugin could not be deleted due to an error: Unable to locate WordPress Plugin directory
- Moving wordpress from TLD to sub-folder (URL structure only)
- Multiple Domains Same Install Different Static Pages