¿How about getting the ID from de configuration?
<?php $page_for_posts = get_option( 'page_for_posts' ); ?>
As the page you are looking for now displays the posts, you are in the loop for posts, not the loop for the page.
Related Posts:
- How to display on the blog page the posts corresponding to the selected language, using Polylang
- Creating a new blog using PHP
- Is the “Posts page” really required? Can problems occur if I leave it blank?
- multiple blogs on single site
- Building articles grid
- Having trouble showing more blog posts on my grid blog layout
- Separate blog on one WordPress
- How to reverse wp pages links?
- Host a blog engine in my wordpress site
- How do I set up “blog” posts to a page other than the main/home page?
- Why is the_permalink not working?
- show scheduled posts in the calendar
- There is no link or button to my blog page
- How do i remove Responsive navigation bar from from single blog post
- How to show page content as well as post lists
- Latest post showing up as main title of page on blog page
- Archive posts on showing current page instead of archive
- Blog page is not showing properly
- How to list blog post from subdirectory wordpress install to the main site
- Check if current page is the Blog Page
- Creating custom blog page template the right way
- Show Default Editor on Blog Page ( Administration Panel )
- I put my blog on a subpage, how do I get page title?
- ID for posts/blogs page
- What is archive.php used for?
- Display content from a specific category
- Blog.php or how to display recent posts?
- Non existing blog pages are not redirected to 404
- Permalink: postname EXCEPT for blog
- Custom fields won’t display on my blog page
- Exclude category on blog list page
- index.php template is used instead of blog page
- How to change the permalink structure of a master page?
- How to change the link structure of the homepage?
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to get the list of posts in a static page other than front page?
- Why aren’t my posts showing?
- is_page(id) not working for blog page
- How can I have a static title on my blog page?
- How to display blog posts on a dedicated page?
- How can I show the actual content of Posts page because the_content() is showing all blog content?
- How to display only the excerpt in the blog/posts page with Gutenberg?
- Custom Theme Blog page not showing Posts
- Automatically adding post and pages to new blog setups
- I am having trouble with article formatting when exporting/importing articles from the production to the development environments
- Setting a static home page and blog page without using the settings
- How to block access to blog-page for users not logged in?
- Changing next and previous post link text
- Defining different theme for Blog posts page
- Multiple Blogs on one site. Best Practise
- How do I make the homepage as the blog page?
- Create a front page template and separate page for posts?
- home.php not loading
- Blog Posts not showing title
- Adding parent pages to posts
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Allow a static page to show on a dynamic home blog page before the posts
- How to create Blog Post Specific Widget
- Show the page title on blog page
- Do I need an empty page for a different blog page?
- How do I get blog posts to appear within CMS?
- Can I install/embed WordPress on a ‘single page’?
- Front page with registered query params in URL shows blog archive instead of front page
- Apply a style for 4 blogs and another style for the next 4 blogs in wordpress blog page?
- Blog page Server error 500 with stick post loop in query.php
- Problem with Comment link in Blog [closed]
- WordPress Blog – Grid View
- Blog page problems
- How to create first post, fifth post full width, rest in three columns and so on
- Adding code to head to all pages manually
- wordpress blog posts’s time
- Trouble getting the Blog page to show up correctly
- Exclude Custom post type from /blog page
- Display a single category in blog section
- How to Get The Excerpt of the page that displays Blog Posts
- How to remove the h6 tag for the entry-category Class
- Customizing a blog page layout
- Site shows URL instead of “meta title” after deleted few plugins (not any SEO plugin was deleted)
- Automatic blog page with custom design [closed]
- Best way to change the blog page post type?
- Showing “best posts” in front page
- How to set a certain Custom Template to a Single Blog Post
- Multiple Blog Pages
- Best practice for implementing a blog page / section in wp_menu_nav()
- Show preview of wordpress posts on external html sever
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- Blog post is redirecting to home page
- Post Publish date not display on Umaya Child themes
- Show only Current category and sub category of custom post wordpress
- “Blog pages show at most” in setting not working
- Use a 301 to Redirect any 404 from at the blog post level to the blog archive
- Is there anyway I can call the year once?
- Display latest posts from a specific categories
- Blog page and the Home page showing the same content
- How do I get the Revolution Slider in the header on the homepage, but not the blog index page?
- No comment Section but still got a Comment
- How to add a blog filter bar without paying money. (example inside)
- How to force set same page as homepage and blogpage in static page settings
- WordPress Iframe for blog image
- How to use a PHP file to control the content of a blog post