the ‘posts page’ ID when using a static front page and a different posts page is:
get_option( 'page_for_posts' )
in some context:
if( is_home() && get_option( 'page_for_posts' ) ) {
$page_ID = get_option( 'page_for_posts' );
}
Related Posts:
- Showing random content / pictures from earlier posts in a sticky post?
- How to get the post’s parent ID?
- How blog page in WordPress works : blog page retrieve first post ID
- Get page ID of page that is set as the posts page
- Are post ID’s reliable?
- get all posts ID from a category
- Get the current post ID as a variable in Javascript
- Is post ID number always incremental n+
- How do I convert a mathematical Microsoft Word document to a WordPress blog post?
- widget should display post archive by year and on click also by month
- how to display full post with pagination on home page
- $post->ID displays wrong ID
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID
- Single Post Gallery Using Shortcode
- Get the post_id of a new post
- How to share same post to multiple site in wordpress?
- How can I display a specific user’s first published post?
- Side by side blog posts that are tied together
- How to show a full post, not just an excerpt
- Custom excerpt length filter doesn’t work
- Can a page_id and a post_id be same?
- Limit Gutenberg blocks available to users to choose from
- Getting current post ID in functions.php
- Blog Posts not showing title
- Remove certain post-formats from showing in blog?
- Blog Posts in Custom Menu
- Post-ID in url differs from $post->ID
- Displaying Latest Posts on a Page
- How to make number of blog posts a custom field?
- Choose whether to automatically add a taxonomy with the same name as the post
- How can i display gallery shortcode output under Post text
- Display posts from a different website on Genesis Responsive Slider
- Is it possible to change post id for an already added menu item in WordPress?
- WP Bakery Load More Button loads the same posts
- Get ALL post ID’s export list (Only id’s. Php or sql not important )
- add new post default view
- Append class to posts page
- Search results posts_orderby and ID
- Posting blog entries in screenplay format
- Retrieve post ID from “querying” URL
- Single.php – Get Current Parent Category
- How to get a post’s content? [closed]
- obtain the author id given the post id
- How to get ID of the page included with get_page()?
- Why I can not I use the variable outside my function?
- retrieve the oldest post id
- How to get the latest URL of my blog?
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- WP_Query custom field pass the post id
- How to set a certain Custom Template to a Single Blog Post
- How do post IDs work in WordPress?
- The loop starting at a certain ID
- Sidebar on single.php not showing up
- Where is the “Posts”/”Blog” template?
- Widget to show posts in the sidebar basing on its IDs
- Making posts permalinks consistent numbers
- How to separate each individual blog post?
- How to get post id of last approved comment?
- Direct some posts to only appear on a specific page
- posts and cms and posts again
- Create a List of Widgets, where each widget holds three attributes
- Post Image Gallery After Content Function messes with other content
- WordPress Post ids big increment
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- How to fix wordpress blog post error? Can anyone help to fix this issue?
- WordPress empty page! what is wrong with this code?
- Reuse old post ID for new post after deleting post
- Use posts from old db by changing prefix
- Bulk find & replace on WordPress posts/pages (minus image paths)
- How to backup WP blog posts to computer, not new site
- Get post attachment with post id
- Blog featured images disappeared on my homepage
- Blog Page doesn’t show summary but full content
- Get posts from category from custom query
- My posts page is missing the page title
- Blog Post slider not working
- How can i take all ids from untrash_post action?
- How do I apply a wordpress function to something with no ID inside an archive page?
- Get from the dashboard the ID of the current post being edited
- Surrogate ID for posts, is there an alternative field in the posts table?
- Edit Posts Page but not category specific pages?
- Is it possible to have dynamic post id # in add_menu_page()?
- Link post to blog from a static page
- Hide first blog post in content and output it in widget
- Using Post ID and Page ID in same function
- new blog post does not appear in blog after publishing
- unused post IDs
- Get image paths from RSS feeds
- 2 tick boxes appearing below comments
- Wanting to apply different featured images for each post
- Custom post page has attributes of latest post [closed]
- Post only showing on homepage when Logged in – direct URL still working
- Posts not showing up on Blog page
- Can I get custom post items in select box (dropdown)
- The page that displays Posts on homepage
- How to save the same post in multiple blogs?
- What is $post->ID
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- View post with specific category id and name which I selected in the backend (drop-down option)
- How to get post ID after removing that post?