You did not explain your question well so I am guessing quite a bit but I think you want something like this:
function post_ids_wpse() {
global $wp_query;
$ids = wp_list_pluck($wp_query->posts,'ID');
$scs="";
foreach ($ids as $id) {
$scs .= "[wp_value id='{$id}']";
}
echo do_shortcode($scs);
}
That is very crude. You should check that the various values are sane before trying to use them, for example.
The idea is to grab the main query object from the page and create shortcodes from the IDs it contains.
Related Posts:
- Update all posts automatically when using post_meta
- Stop WordPress automatically adding tags to post content
- How to change the case of all post titles to “Title Case”
- WordPress removing tags?
- Confirmation box when submitting post for review
- Ajax Load More Posts in Category Page
- List latest posts in WP-Admin
- Getting the Next and Previous Posts Titles in the Sidebar?
- Search & Remove Specific Shortcode From All Posts
- Change slug with custom field
- How To Ignore a Filter On Applying Filter the Content In a Function
- Restrict access to post if it is currently being edited
- Post X of Y in single.php / sidebar.php
- Create new category upon save based on post information
- Strange switch_to_blog() issue
- POST from jQuery to PHP
- Display all posts under child sub category in sidebar on post page?
- How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?
- $post object is null
- Hide Post comments when displayed via WP_Query
- Function to show random posts from a category
- Styling images coming from another blog
- How can I hide the sidebar from a specific post?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- UberMenu list current user’s posts as menu items
- Sidebar links for different pages
- Duplicating Table of Contents for Paginated Post
- Get latest posts from WordPress site without header, menu and sidebar
- Display post category in foreach loop with category link
- do_shortcode within post query
- WordPress Custom Fields (Checkboxes with multiple values)
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Most liked page not displaying posts
- get_the_content(“more…”) returns full text
- How to make number of blog posts a custom field?
- Is there a straight-forward way to iterate over all shortcodes in a post?
- How can i display gallery shortcode output under Post text
- How to display Common posts from specific Tag & Category with Shortcode
- Can wordpress post and sidebar remain visible after scroll?
- Creating a post from data returned from HTML form
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- 2 dynamic sidebars registered, not showing up
- Page template is accessing the incorrect posts?
- Sidebar show posts by current category also in single post
- $wpdb returns duplicate posts
- Get post meta retrieving wrong value
- How come a YouTube link isn’t transformed into a shortcode inside the post content?
- WordPress 302 Redirect to Random Product/Post/Page
- How to convert query sql to shortcode in wordpress?
- How can I add 2 buttons with shortcode
- Adding a meta box to determine the sidebar [closed]
- How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?
- Widget to show posts in the sidebar basing on its IDs
- How to display only one category in a custom post type?
- Display message depending on capability outside loop
- Sidebar limiting to 10 posts?
- Adjust the order for returned posts
- post/page content
- Getting post and attached image from subdomain
- Defining ‘last’ class on foreach blog posts
- Categories Listing and Highlighting current category item
- Help Combine These Two PHP Codes
- get category in list of posts // shortcode for custom related posts
- shortcode // get posts by ids
- Display “no post” message
- Featured Story Shortcode not outputting content
- Time Stamp In A WordPress Post Title That Does Not Keep Refreshing
- Contact Form 7 Shortcode not recognized inside another shortcode
- Display Post from Custom Post Type with Shortcode
- wp_insert_post() Add and specific ID to the body of that
- Add a url parameter to the current post and read it in a shortcode
- Single Sidebar; multiple templates! How?
- Secretly passing post ID/title etc into a shortcode form automatically to link submission to post
- I need show posts by customer (Shortcode)
- Posts on Sidebar only
- Is it possible to query a category with specified posts?
- Shortcode: How to add custom posts?
- How to display most popular posts from certain category in sidebar?
- Shortcode for printing post titles
- How to use extract shortcode in loop?
- How to limit the number of results for all query_posts on mysite
- Get first comment link on the post itself
- Display only posts with comments
- User driven content problems
- How can i retrive the movies, trailers, news in a single page using search
- How can I create a menu items from meta box based on users input
- How do I display a full post, not just an excerpt?
- Remove read more
- How do I display the next 3 posts in the sidebar?
- wordpress radio button on single post page
- How *not* to show the last post on the latest posts list
- How do I add an article to specific page?
- Exclude a ‘portfolio’ custom category?
- Display a custom field rating system in the front end
- WordPress Yoast SEO plugin Post Save/Update Issue
- Insert Shortcode exactly at the end of the content
- Trying to create shortcode listing custom posts, but formating not being included
- Undefined Function Fatal Error with Shortcode [closed]
- my website didn’t show the defult right sidebars