If by ‘blog page‘ you meant a static page set as posts page in the Reading Settings, then you could check it by doing this:
if ( is_front_page() && is_home() ) {
// Default homepage
} elseif ( is_front_page() ) {
// static homepage
} elseif ( is_home() ) {
// blog page
} else {
//everyting else
}
When you use
is_home()
andis_front_page()
, you have to use them in
the right order to avoid bugs and to test every user configuration.
(Source: Conditional Tags – The Blog Page)
Or simply:
if ( !is_front_page() && is_home() ) {
// blog page
}
Or more simply (I suppose):
if ( is_home() ) {
// blog page
}
Related Posts:
- How to use a PHP file to control the content of a blog post
- Looking to exclude blog posts from category Previous/Next buttons
- is_page(id) not working for blog page
- Customize Time Stamp
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- How do I ensure that a piece of hard code only gets called, when on my appointed Blog page?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Can I install/embed WordPress on a ‘single page’?
- Blog posts repeat
- Different post styles depending on category
- Loading index.php contents which located outside blog folder for post single page
- Custom Pagination is Broken
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- How to remove the h6 tag for the entry-category Class
- Using featured image of blog archive page
- How to make blog post entries appear as input form instead of just text?
- WordPress loop is not working
- Wrap posts p tags in div
- Fatal error: Cannot redeclare comment_theme()
- Is there anyway I can call the year once?
- Move blogs but with applied filters
- WordPress Recent Posts – Loop
- LinkedIn Share Post Button
- Blog Image and Title in Right Sidebar
- Echo the featured image of page assigned to blog in index.php
- Inserting A Feed and Sidebar into an HTML Page
- why is this content-template not showing any of my blog-entries?
- WordPress blog set up
- Tables not showing divs and loop/php items
- In reading settings posts are set to “blog” and I have page-blog.php but no posts
- How do I remove blog entries from home page Twenty Eleven child theme?
- Blog Posts not sorted and pagination not adjusted after filtering some category
- Shortcode Displays 2 times
- Display posts based on the selected category when no subcategory is chosen
- How can I list only Subcategories in Woocommerce
- PHP Syntax getting PHP terms
- PHP-Code inside Href-Tag
- PHP Call to External Database
- How to post data to a word press site in case of a mobile app
- What languages were used to build WordPress? [closed]
- WordPress plugin/code to to to next/previous post in same category
- how to get category name if my category got custom slug
- Alternative loop syntax error [closed]
- How to strip/remove all blank spaces at the beginning/end of a search string
- why my “recepie” category is not taken into account in my request
- How can I execute $string = if();? [closed]
- Parse error: syntax error, unexpected ‘echo’ (T_ECHO) in C:\xampp\htdocs\AttendanceSystem\resources\php\method.php on line 250 [closed]
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Adding php within a return statement [closed]
- How to add margin underneath woocommerce total price amount -> productpages
- Pagination in category.php not functioning
- Display post of specific category on page
- HOW TO Insert Existing PHP Code to WOrdPress
- where is the mistake in PHP Warning: Invalid argument supplied for foreach() in line 3
- How to show blog posts changing every time after refreshing the page in non-wordpress website?
- SHARING TO FACEBOOK – FROM DYNAMICALLY GENERATED PAGE
- Echo piece of code from file
- Adding placeholder text field to woocommerce checkout [closed]
- Query posts by custom fields (object post)
- Cannot modify header information – headers already sent
- Adding multiple emails to a
- Query Concatenation
- Send foreach $_post method to contact form 7 [closed]
- WP Debug enabled Undefined index error in a widget
- php 7.0 update to 7.1 and at least 7.2
- Warning: Cannot modify header information
- Can I have a php site on subdirectory of WordPress?
- How would I split the results into two columns [closed]
- ACF Date fileds to Age Convert [closed]
- is there away to hide php code in wordpress not to show in PAGES
- Displaying categories
- Whats wrong with my code? Need To add String to shortcode? [closed]
- Why this Read More Not working in Php?
- How to combine array info [closed]
- How to get the Woocoomerce subtotal value without tax in the hardcode? [closed]
- How do I get Roboto Google Font to display normal font-style? [closed]
- Select area and checkbox data is not saving?
- Save custom field value to variable for conditional – why is this not working? [closed]
- Shortcode always at top of content
- Populate checkboxes from array
- My title is showing after the shortcode
- Display popularpost posts of the last 2 days
- Cookie not created in AJAX request
- Display Sale Price Before Regular Price (WooCommerce)
- on category page get name of category as a string
- How do I reformat this to add php inside php?
- WordPress categories not working throughout site
- Query category name by variable
- Load a Header in wordpress
- Advanced custom fields Repeater conditional statement not working [closed]
- Load files content [closed]
- Using PHP for background-image property [closed]
- Where is the POST response body generated in PHP? [closed]
- Trouble figuring out how to get my button to submit comment
- How to include a php file in every post and page [duplicate]
- Link to external page has wordpress blog-url inside
- archive per year with monthly
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- Convert ACF checkbox choices to links [closed]
- How to modify this function to exclude also the post belonging to a specific category?