Try if ( 'page' == get_option( 'show_on_front' ) ) {}
.
Edit
but I’ve tried adding and replacing
<?php endwhile; endif; elseif (is_home()): ?>
with both of your code. Could you perhaps include your snippet with mine?
I’m not sure why you would do that. I was specifically answering this question:
But what if a page (instead of the ‘blog’) is the frontpage? If possible I’d like to include the option as well.
The answer to that question is what I posted:
`if ( 'page' == get_option( 'show_on_front' )
However, that won’t actually solve your problem, if I’m reading your code properly. Reading what you’re asking, this should work:
if ( is_single() || is_page() || is_front_page() )
(Note: I used ||
instead of OR
as the Boolean operator.)
To be honest, I’m somewhat surprised that this works on static pages. I didn’t know that they generated RSS output.
Related Posts:
- Programmatically set page_on_front
- How to make my front page display only the most recent sticky post, plus usual widgets?
- How does WordPress decide what template to use as frontpage
- How do I set the front page programmatically?
- Custom background for the index page only?
- Load front-page.php from subfolder
- Can you select a post as the front page or only pages?
- Can’t edit front page of website [closed]
- How to block access to blog-page for users not logged in?
- Pagination not Working on only Front page on latest verson of WordPress
- Can we allow users to choose front page from theme options?
- Do I need an empty page for a different blog page?
- Set front page option using custom fields?
- Is it possible for homepage in Twentyseventeen theme to look like a standard page?
- WordPress site front page fails to load in IE
- Home/front page won’t display content after a form is submitted
- how to create a static front page for my blog in wordpress
- Home link in the homepage of my wordpress does not show my blog posts
- WordPress, how to figure out how to edit front page
- How to set wp_options in functions.php for removeing the Default Front Page
- Different Front page for Mobile
- How to set a static html front page
- NON Static-Front Page
- Front Page Settings
- What code controls the animation for the front-page header in TwentySeventeen
- Setting index.php as a static home page without posts?
- Implement a slideshow-like frontpage with text overlays
- Showing “best posts” in front page
- Pull in content from page defined as static front page
- Excluding front_page from is page condition
- Why does my site show the correct front-page when you arrive at the site, but not when you click ‘home’?
- Change Front Page Word Press 4.1
- custom change in front page [closed]
- Remove edit post link from static front page
- WordPress certain directories not connected
- Different front page for logged in and logged out user but the same URL in WordPress
- Use alternative front page if cookie is set
- Homepage not working after setting as frontpage
- Hiding New Posts on Front Page
- change header height on 2017 theme for logged in users
- How to connect front-page.php to page in admin panel?
- Can I have two websites with one front page
- I created a new home page and set it as the home page in the reading section, but I get an error when typing in the home page url
- Categories with post from child categories on front page
- Static front page – going against the grain
- When Front page and Posts page are specified is it possible to just have front-page.php as the home page?
- Custom background for the index page only?
- No posts on front page
- How to display only sticky posts on my automatically generated front page?
- Front page welcome message area
- Static front page as parent of with child pages?
- How did WordPress link an empty page at dashboard to an actual php file?
- How to show all columns’ names on a large pandas dataframe?
- GCC -fPIC option
- How to print the full NumPy array, without truncation?
- Upgrade 4.5.2 to 4.5.3 deleting row in wp_options table
- When to use is_home() vs is_front_page()?
- Are transients garbage collected?
- Get page ID of page that is set as the posts page
- How to get WordPress Time Zone setting?
- framework for plugin/theme options panel? [closed]
- How to get the Date Format and Time Format settings for use in my template?
- Add multiple custom fields to the general settings page
- How do I add CSS options to my plugin without using inline styles?
- Are all options loaded to memory on each request?
- ‘Global’ settings page for multisite plugin
- How does object caching work?
- “Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin
- How to pass arguments from add_settings_field() to the callback function?
- Using pre_get_posts on true pages and static front pages
- How to use checkbox and radio button in options page?
- how to update serialized options programatically?
- get_option() vs get_theme_mod(): Why is one slower?
- Slow Query for the wp_options table
- How to add Custom Blog Options to new blog setup form?
- Is get_option function cached?
- Will it break my site if I delete all transient records in wp_options table?
- How to pass variable to add_settings_section() callback?
- How come `wp_options` table does not have an index on `autoload`?
- How to add field for new site-wide option on Network Settings screen?
- Update Option Stored in Multi-Dimensional Array
- Contact form 7 select box different value-text than content-text in option [closed]
- Performance with autoload and the options table
- Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?
- What’s the difference between Options & Settings?
- Using widget options ‘outside’ the widget
- Please explain how WordPress works with MySQL character set and collation at a low level
- What are the advantages to the Settings API?
- How to load WordPress on non WP page?
- From a security standpoint, should bloginfo() or get_bloginfo() be escaped?
- Where to securely store API keys and passwords in WordPress?
- Adding Widget form fields dynamically
- Where to store plugin settings fields
- Enable page templates. How?
- How to store widget fields data as an array?
- Using jQuery to delete data stored in wp_options
- Limit the number of inactive widgets
- Is get_option() faster than accessing get_transient()?
- How can I create a “Read More” link using the_excerpt() on a static front page?
- This CSS Stuffing Works, But Is This A Good Practice?