You should be able to get the queried object id and use that for comparison inside your custom loop..
Before your existing loop code(what you have posted above), but obviously after the opening PHP tag..
global $wp_query;
$current_id = $wp_query->get_queried_object_id();
Then somewhere inside your custom WP loops..
if( $current_id == get_the_ID() ) {
// This result is the current one
}
else {
// Not current
}
Hope that helps..
Related Posts:
- Retrieve each widget separately from a sidebar
- is_active-sidebar loop
- WordPress shortcode in content, output in sidebar?
- Exclude current post ID from loop in sidepbar.php
- Variable not working in sidebar loop
- Jquery Slider for profile template
- Should I use loop in the single.php file?
- $post>ID displays wrong post ID
- How can I custom order the results from wp_list_categories?
- Add 20yrs to post date, and then query
- When and Why is is_singular(‘my_cpt’) true while in_the_loop() is false?
- Display all authors and their only one latest post
- Remove comma from last item output from loop
- Getting page ID inside loop
- Page template not displaying
- How to show just private posts in loop
- How to paginate this custom loop? [duplicate]
- Can I use both a custom excerpt and a trimmed excerpt?
- Select data from database and list it in Loop (WordPress)
- How to get_template_part using AJAX?
- wp alchemy multiple image uploader output images to template
- Running a loop with a custom query string on a custom page template
- I’ve been out of the loop since 2.8. What did I miss?
- Loop first six posts in carousel, next eight in grid
- Infinite blog loop
- One custom loop with condition to check child posts
- Loop get_theme_mod
- Move sticky posts down in main loop
- Why only one post (and no pagination) on this variation of the loop?
- How do I go about looping through a advanced custom field on a particular page inside of another page
- Template structure
- The Loop – mixed ASC and DESC order
- Filter the_posts doesn’t work on search page
- Custom Loop Using Shortcode in Custom Page Template
- Listing subpages title and content and styling the first iteration differently
- Cannot retieve the_content() and the_author() – both returning empty strings
- How to order by multiple fields using standard query_posts?
- How to get the excerpt for is_home() outside of the loop isn’t working
- Make loop alphabetical
- How to check if a product is purchased within the last 365 days before displaying something
- How do I get my loop.php to properly paginate?
- Category links including all posts
- Custom loop ordering not working
- First archive page with a few posts
- Loop through ACF taxonomies and output associated posts
- How to get user ID’s from multiple usernames?
- How to display first post
- Pagination on custom post type on front-page.php
- Query posts only with actual text content (not including shortcode or images)
- CPT while loop not working
- Problem with Front-Page.php loading recent posts
- How can this multiple loop have pagination as described?
- Default featured image set as background image [closed]
- Breaking up the results of a loop
- Where to add offset?
- How to synchronize The Loop with the max post per page?
- How to add a byline to all the pages?
- How do i create a list-posts-page?
- Exclude posts based on an array
- Displaying member join date on page
- Is file_exists() compatible with timthumb.php? [closed]
- List ALL posts by author on author archive
- Using is_page_template inside loop
- Archive: Lists itself
- How to show the last article in a different way in my blog?
- Can’t limit posts_per_page in loop
- Reorder posts in a loop: have the posts by one particular author below the others
- Slug is changing when I use WP_Query in a metabox of a post
- how to get author comment inside the loop?
- How to create loop in custom page, and get id from url into this loop?
- How to fix pagination for custom loops?
- Check to see if a field is within an array in twig
- Custom loop not working in singular.php, working in other pages
- Strange problem with wp_get_attachment_image_src database (db) query count
- How to include posts from one category, into a separate category of posts?
- how do i make this loop work
- Archive sorted by month – separate
- Making a specific page wordpress compatable that is not index
- Display single post inside accordion based on form submission results
- One page loop issue with posts
- Humanmade | Custom meta box class: How to display a repeatable meta box group?
- Can’t print out returned value
- change the_content images for different sizes (Desktop, tablet, mobile)?
- Building theme so user can change header image [closed]
- Get query result before posts are displayed?
- WordPress Group By Problem
- Home page loop with pagination problem
- WooCommerce custom loop pagination on front page
- Eliminate duplicates in a foreach loop [closed]
- Tag custom loop show posts
- get_page() unlike Loop returns the post content without html tags. How can I fix this?
- Problem with ms-thumb-frame-selected class in Master Slider
- I want the first post on my home page to be lengthier than the rest (example included)
- Loop with Custom Post Type Taxonomies and Interstitial Code
- Question about custom plugin
- loop mix my child-category and parent-category
- How can you make it so the comment box shows on some pages or posts but not all?
- How to get files from loop for zip
- Divide loop into several columns based on post custom field and enable infinite scrolling
- Query Loop Block: possible to restrict just child pages?