Why not just use the_ID()
which will always be unique and won’t require any extra code to be used.
Related Posts:
- Endless loop with wp_insert_post and wp_update_post
- Add Incrementing ID to each paragraph in the_content
- post__in – Placing content from a foreach loop inside of an array
- In a foreach loop, how do I target the last item in the loop?
- How to iterate through database until it find a match
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- How to print out menu names in the foreach loop?
- Add class to last 3 posts in loop
- Output meta into arrays
- Need to add class to first element in a foreach loop
- Foreach displays from last to first
- How to print redux gallery feilds id? [closed]
- How to check all items in a loop have post thumbnail?
- Get featured image outside the loop using foreach
- Why loop renders only last metabox from array? [closed]
- Foundation modal in wordpress php loop
- ACF field not appearing correctly in loop
- Eliminate duplicates in a foreach loop [closed]
- Wrap every 2 divs in row – for each loop [closed]
- ACF loops false value with repeater and checkbox
- Counting the posts of a custom WordPress loop (WP_Query)?
- Get post content from outside the loop
- Is there any difference between the_title() and echo get_the_title()?
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Display subpages under parent page as a list within a loop
- When to use wp_reset_postdata();
- Related Posts loop – offset
- Custom post type loops with different page templates
- WordPress Loop Through Particular Pages
- Showing current subcategory
- Display date only once for a each set of posts relating to that date
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Displaying Only Certain Tags in Loop
- Generating dynamic Tabs with multiple query post loop
- How do I override part of the main loop in my child theme?
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Way to display “Yesterday”, “Today”
- have_posts() execution failure
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- CPT + CMB2: data not displaying for only first post in loop
- Only display videos and images in the_content() within loop
- Get search.php results in header.php?
- Recent posts on a static home page
- Query last updated posts (posts updated in the last 24 hours)
- I write simple wordpress loop for taxonomy.php file but don’t show result
- Can’t find infinite loop cause
- How to hook into container
- Exclude first post (sticky or not) from the loop using query_posts()
- WP_Query fails despite having 1 post
- How to add a specific div element to the first post in a row?
- Loop stopped working
- Loop increase number
- Scrolling Posts with Ajax
- Sort posts by first letter in the title, not by first number
- how to replace get_template_part(‘loop’,’tag’) with explicit styled version?
- What PHP Needed to Make One Loop with Multiple Styling?
- facebook like, tweet and google+1 buttons inside the loop on home, archive and search pages and missing facebook like buttons
- Loop Offset for tag based “Related Posts”
- How do I put my frontpage featured image in a page template for home.php?
- Randomly display post based on meta value. (Kind of Priority/Weight)
- Why the first with flexslider appears as blank on my code?
- Rendering pages
- foreach loop inside the loop creating duplicates in output
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- Echo array value
- WP_Query is only looping home page, not pages
- How to filter posts by category INSIDE the loop
- How to break up php code to avoid echo
- static page with multiple loops breaks post pagination
- new custom theme – posts displaying on top of one another
- Help with if and else statement
- Building a form with WordPress, and also pulling that data for a user page
- Products listing check if meta checkbox is checked
- Adding a second loop breaks everything
- Custom Query with Sticky Posts
- How do if all posts has this category ID then do this
- is it bad to copy the loop for a template?
- I want to load post in bootstrap Modal dynamically
- View tag description on page
- Why my loop is repeat?
- Return only one post format in index.php [duplicate]
- How to display just video post format?
- Is it possible to get a post ID of a 2 different custom post types loop embedded in the same post to perform update_post_meta from the frontend?
- Display product attributes for current product
- How to execute custom loop before loop content?
- Sorting posts to make those with post thumbnail show up first
- Best way to check if a post with specific meta exists
- Return only content in excerpt field in loop
- Default Template infinite loop of Title
- How to have post count after each listed category
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- How can I put a custom field as the link of a button shortcode?
- is there away to hide php code in wordpress not to show in PAGES
- Error in Wordprewss loop for page template [closed]
- Tags outside the loop