Title: Loop item post ID in shortcode?
Last modified: January 17, 2024

---

# Loop item post ID in shortcode?

 *  [nitrospectide](https://wordpress.org/support/users/nitrospectide/)
 * (@nitrospectide)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/loop-item-post-id-in-shortcode/)
 * I created a shortcode I want to use in my AQL loop. The shortcode needs to grab
   the ID of the item the loop is currently iterating through, but using get_the_ID()
   in the shortcode returns the ID of the post/page the loop is placed in, not the
   one the loop is currently iterating through. How can I get this to properly see
   the current loop object?

The topic ‘Loop item post ID in shortcode?’ is closed to new replies.

 * ![](https://ps.w.org/advanced-query-loop/assets/icon-256x256.png?rev=3106826)
 * [Advanced Query Loop](https://wordpress.org/plugins/advanced-query-loop/)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-query-loop/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-query-loop/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-query-loop/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-query-loop/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [nitrospectide](https://wordpress.org/support/users/nitrospectide/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/loop-item-post-id-in-shortcode/)
 * Status: not resolved