Dont use query_posts
or WP_Query
if you need it in the main loop. Dont ever use query_posts
anyway.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php $current_id = get_the_ID(); ?>
<?php echo $current_id ?>
<h1><?php the_field('titleFart', $current_id); ?></h1>
<?php endwhile; // end of the loop. ?>
<?php endif; ?>
Because: get_the_ID()
Related Posts:
- WP_Query custom field pass the post id
- Get page ID of page that is set as the posts page
- Are post ID’s reliable?
- Get current post id in functions.php
- get all posts ID from a category
- Get the current post ID as a variable in Javascript
- Is post ID number always incremental n+
- Are all ID’s used unique?
- $post->ID displays wrong ID
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID
- get_post_custom stripping styling issue
- Showing random content / pictures from earlier posts in a sticky post?
- Get the post_id of a new post
- How can I display a specific user’s first published post?
- Undefined variable post_id in custom quick edit coloumn
- How to get Advanced Custom Field Value According using POST ID? [closed]
- Getting post id from wp_insert_post_data function?
- Does an article (post) id ever change?
- How to get the post’s parent ID?
- Can a page_id and a post_id be same?
- Is there a better, more efficient way to get the post id outside the loop?
- Getting current post ID in functions.php
- Buddypress activity id
- How blog page in WordPress works : blog page retrieve first post ID
- Guest Author – How to display posts on /author/ archive page
- Post-ID in url differs from $post->ID
- Why is my Blog Page ID == First Post ID?
- current post with current author
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- Is it possible to change post id for an already added menu item in WordPress?
- Check if checkbox is marked on publish/update post
- Get ALL post ID’s export list (Only id’s. Php or sql not important )
- How to get next post ID?
- Query values from a Post Object Repeater [closed]
- Search results posts_orderby and ID
- Retrieve post ID from “querying” URL
- Saving custom fields to a custom taxonomy
- 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()?
- How to I retrieve the ID from the Posts page?
- Crazy Question – Updating Post ID
- Why I can not I use the variable outside my function?
- retrieve the oldest post id
- ACF to select posts not displaying on blog page
- Getting property of non-object when looping through post objects from ACF
- Update post meta within save_post action
- Saving Post Data in Another Database
- Add hero image to home page (blog format) via the dashboard
- How to display post list in a table layout (multiple queries in single loop)
- Accessing Post ID Within Loop
- How do post IDs work in WordPress?
- Are post, page and category IDs unique to each other?
- The loop starting at a certain ID
- linking to post outside the loop
- If custom field is empty, use one from a previous post
- Widget to show posts in the sidebar basing on its IDs
- Get a post’s ID
- Making posts permalinks consistent numbers
- How to get post id of last approved comment?
- How to get the post id (of the parent custom custom type) in a loop inside a widget?
- ACF flexible content block not showing on live site (works locally)
- ACF date picker to trigger category change
- search form for custom fields
- How to work with posts and sub posts?
- Get post slug and match with menu item slug to change css
- Run a function when a custom post is update?
- WordPress Post ids big increment
- Reuse old post ID for new post after deleting post
- Template with ACF and Pagebuilder
- Get post attachment with post id
- Change post value in WordPress
- Assign a day of the week to post, e.g: Assign Monday to post and have it only appear when the day is Monday
- 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
- Only get post_id [duplicate]
- WordPress Request Post All Post ID in a Loop? [closed]
- Auto populate custom fields by post date
- Surrogate ID for posts, is there an alternative field in the posts table?
- ACF Relationship – Get Parent’s Post Object
- Is it possible to have dynamic post id # in add_menu_page()?
- Run function after post is updated
- Using Post ID and Page ID in same function
- unused post IDs
- How do I show the post title if an advanced custom field hasn’t been used?
- Custom post page has attributes of latest post [closed]
- How to make a local “scroll to ID” on post?
- Can I get custom post items in select box (dropdown)
- Custom post order returning posts from other categories
- What is $post->ID
- How to detect if an ACF custom-field is really in use?
- 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?
- How to make internal links creating plugin to respect ACF?
- Add “reviewedby” in WordPress posts
- Why does ‘get_the_ID’ work outside of the loop?
- Need to display a Jan 1st post as the site’s front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc
- query posts with selected post ids first
- Ajax: load content from post I clicked