Get postid of posts included in Query Loop
-
Is it possible to pass the post_ID ‘s of each CPT that is included in a QueryLoop – For use in a containing element?
Basically, the post ID needs to be passed to a shortcode (button) that needs it to check if a user is ‘following’ each specific post.
The shortcode is part of a custom plugin that we have working in other sections of the site, apart from the home page- where we use the QueryLoop to bring in elements of a CPT posts. We need the postID to add it to a data attribute. EG. data-post-id=”XXXX” .
Hope I have explained this well enough.
Mark
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Get postid of posts included in Query Loop’ is closed to new replies.