Indeed, if your site has a static page on the front, the condition is_page
will be true and WP will never get to the elseif
.
If you want a different template for your front page, you should exclude it from the first condition so it will return false in that case. Like this:
if ((is_single() || is_page()) && !is_front_page())
Or you can switch the statements around: first test for home/front and if that fails for single/page.
Related Posts:
- Shared Content but “Updatable” Through the Main Site
- WP Multisite: Adding pages on blog creation by default
- Hard Code Pages into a Theme for a Network (multisite) Installation
- Auto create pages on WordPress multi site register
- How to make wp-signup.php a 1-step process [closed]
- Use another author.php if different multisite subsite?
- Network Plugin Creating Pages for Different Subdomains
- Iframe being removed only for some users when publishing a page
- Query to import data from one MultiSite table to another (pages/sub-pages)
- Create a page for a theme only
- Handling single.php in Multisite
- How to publish some default pages in Multisite creation?
- How to automate setup of theme, pages, widgets, etc for a new site in multi-site?
- Pass form inputs to page content
- There is how to change url domain on some posts?
- Update Same Contents on every Page
- Custom pages on all multisite network, to NOT show in wp-admin at all
- Pages redirect me to the homepage
- Iterating over every multisite / theme and list the pages
- WP Multisite child theme: get_template_directory_uri() seeks it’s own subdirectory instead of directory of parent theme
- WP Multisite Sub-Domain Error
- Multisite WordPress doesn’t work properly on virual hosts
- Rewriting request to another site
- Enable HTTPS for AWS hosted multisite domain (with AWS purchased SSL) on already created Load Balancer?
- Downloading customized theme from wordpress
- I want to replicate my sub site similar to my primary site in WordPress Multisite Network
- Getting file errors in a WordPress Multisite ADMIN
- How to migrate post media from stand-alone to multisite build
- How to make the redirects right? IP to domain name folders
- Add new sites on the same level as the parent URL in a multisite
- Domain not redirected correctly with WordPress Multisite
- What is the optimal solution: WP Multisite vs InfiniteWP
- Best way to have multiple custom domains associated with a site within a multisite installation
- Multisite network admin login redirect
- Hook into ‘admin_url’ but only on Mysites admin bar menu
- Add file at the root of mapped domain in multisite
- Seeking solution to sync wordpress sites with Server
- URLs for (MultiSite) link images are always relative
- How to post same content on multisite?
- Is there any hook to validate google recaptcha dislayed in wp-signup page [in WordPress Multisite]
- wp-cli core install –skip-email and –skip-config flags not working on MAMP unknown parameter
- How to add a link of “one” website in posts of “second” website in multisite WordPress
- Primary (root) blog of multisite installation forbidden (403)
- Themes are visible in Network, but invisible in sites
- Duplicate/Clone a Multi-site But Use Same Images & Resources?
- logging out with/without confirmation – single site, multisite
- How to disable Gutenberg editor from Multisite Admin panel?
- Multisite wp-admin redirecting to main wp-admin using NGINX
- WordPress Multisite VMware copy for dev use not allowing loggin
- Multisite subdirecty added inside URL to uploaded files
- local wordpress multisite not working on AWS development server “error establishing database connection”
- Displaying Multisite ID number
- WP Multi Site – configure Sub domain pointing to parent sub directory
- Timber\Image an image from another site in network
- Redirect a user roll to a page after login in mutlisite network
- customize admin bar (desktop+ responsive)
- WordPress Multisite – Domain Mapping
- Register a user only to the root blog – WP Multisite
- Create multiple clones of site with different branding?
- Multi-Network without plugin
- WordPress Multsite Network site under another network site
- 2 wordpress, 2 different themes, some pages with the same content
- WordPress Multisite with Wildcard Certificates not mapping correctly
- Created child theme from Themegrill Flash-Pro and the child theme is blank
- Looking for most efficient way to ‘deploy’ single wordpress page to multiple external subdomains
- Subdomain multisite instances having same content
- Fix nested WordPress multisite resource path?
- Can I add a rewrite rule in htaccess to remove the multisite subdirectory from the URL?
- allow multisite in the installation process
- Using WordPress multisite for subsites only
- WordPress multisite REST API connection refused with android – redirects to home page when using IP address in Postman
- Configure redirects with web.config
- How do I split a single WPML site with 6 languages (English is Main) into Multisite with 5 subfolders
- Multisite installation steps?
- No debug log for WP multisite is created
- Error establishing a database connection after moving local wordpressmultisite from one directory to another
- Multisite network subdomains doesn’t work
- MULTISITE: Password issue and Error Cant access site
- WordPress Multisite with Subdomain, make the subdomain look like another domain
- Will resetting my database affect other sites on my multisite WordPress install?
- Login issues on WordPress Multisite and domain mapping
- trying to install a wordpress multisite in a subfolder and have custom subsite urls
- Can I replace the “Upgrade Network” with SQL query?
- How to convert multisite subdomain from http to https
- One membership area for two websites
- Multisite different domains mapping error on GGS
- Is it better to embed widgets on posts or pages?
- WordPress Multisite keeps redirecting to HTTPS
- WordPress Upgrade – API files returning 404 on Multisite
- Migrating a WP site with 2 WP installations
- Activate User account for Sub Site broken
- Multisites can’t load .php files
- Installing other applications alongside WordPress multisite subdomains
- How install wordpress in another wordpress folder?
- Multisite Dashboard not working
- Search returns “Nothing Found” on a sub directory
- WordPress blog posts template bug [closed]
- Subsites in Multisite throw 404 in wp-admin
- WordPress theme to support single website but with 3 sections for 3 languages
- Can assign a new domain to a site in a multisite?