Converting a dynamic piece of code into a static one is a pretty straight forward task. It’s the other way that is complex.
Any WordPress function that can accept get_the_ID(), can also accept a string as an ID. Some even accept arrays.
So, simply turning
get_post_meta(get_the_ID(), 't_puck_imvi', true);
to
get_post_meta( 123 , 't_puck_imvi', true);
Will do the job.
Note
Not all the functions that can be used withing a loop accept a post ID. An example would be the_post_thumbnail_url() function that only takes a size as its input. In such cases, there are most likely an equal function to use, such as get_the_post_thumbnail_url().
Related Posts:
- Change all author links in Blog roll
- Human Time Diff, change mins to minutes
- How to Display Post View Count
- Exclude category from
- Force the “Choose from the most used tags” meta box section to always be expanded
- The_excerpt() doesn’t parse – how to change that?
- How to only publish posts with image in it
- Add custom text automatically on each post
- Optimize CPT-function with a loop
- The loop starting at a certain ID
- saving/reading custom field value does not work – no value gets POSTed
- Get post category as a separate string and url
- Get post id outside loop : Notice: Trying to get property of non-object
- Show post excerpt
- Show author bio box
- Check if user has avatar
- Run function after post is updated
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- Getting rid of the blog page entirely
- What function does the loop of displaying posts?
- WordPress current post functions inside loop doesn’t work anymore, are they incompatible with php 8.0?
- Find most used words in post titles
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- $post->post_content empty while all other properties are correct
- Function is printing twice – any suggestions?
- How to add a custom class attribute into code wrapper? [duplicate]
- Current post categories and subcatecories outside of the loop
- Private post caught in endless redirect loop
- How to retrieve all meta data directly from the $post object? Such as $post->related_topics?
- Multiple post in One Loop in wordpress
- What is proper filter or hook action to add data to the $post object?
- Display specific posts based on an ID of another post
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- “read more” redirects to the wrong page
- Diffrent layout for posts [duplicate]
- How to show post views shortcode data for each post on Posts List Page?
- Need to display a Jan 1st post as the site’s front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc
- Remove pagination if search returns empty
- Remove HTML tags from all posts
- Set a post expiration and delete a post when expirate
- Count singular post views automatically
- How to distinguish pages created by woocommerce?
- Blogposting Schema & Structured Data without plugin
- Automatically select template based on query string for New Posts
- Moved a website and excerpts don’t work for old posts
- Display Updated Date Instead of Published Date
- How do you update post date (year only) in a separate custom field?
- I want to change the WordPress comments file
- Add postmeta to all blog posts
- show loop id post , only first id can read
- subtracting the current post form then whole loop, which is generating all CPT titles
- Replace Tag Keyword With Link Within Post Content
- Excluding tag Link from html tags in Post content
- Save All Post Permalink From A Specific Category into a .txt file
- How can I get the last post while on the first post for pagination? As if it were infinite
- Loop and output 4 rows of posts on home page
- Bulk Post update_post_meta
- Changing a users posts to drafts upon role change
- Re-order Category Meta-data
- Double loop output
- AJAX load more posts not using correct category and repeating the same few posts
- How to Display Most View Post in the template file?
- How to hide meta from search result only on pages?
- WP_Query sort by meta_value_num or date
- How to show category image if no featured image is set?
- how to call recent post content in a loop ( only the content before read more tag)
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- Loop through all posts showing duplicates
- Can I Paginate Post after every 25 tag?
- Post being duplicated with foreach loop
- Alternative content between posts no repetition
- Start loop from specific post ID
- Grab meta data before post is saved
- post->ID displays the same ID number for every post
- Display new posts categories in separated divs
- How do I apply a wordpress function to something with no ID inside an archive page?
- Wp_query loop is not working as it should
- Show all posts from the tags without having to set all of them
- How to correctly escape data
- How to fetch posts that are stored in the different table than the default table (wp_posts)?
- Display author bio box
- Maximum number of posts per page before affecting performance?
- Use special template for the first post in the loop
- Display post order ranking within wordpress loop
- Posts are not showing up on next page.
- Can the_post_navigation() be outside of the loop?
- Custom post type – Loop out in random order but same 15 to appear first… still random
- Trim excerpt to first paragraph
- WordPress infinite post cycle
- WordPress infinite post cycle problem
- Problem with wp_insert_post()
- How to get all posts in gallery post format template
- im trying make a function to auto correct posts when i open the posts in the backoffice
- alt of attached image in post / pages
- How to control Post view count incresing in sidebar widget posts too?
- Creating Ordered Query using Meta_key
- WordPress Request Post All Post ID in a Loop? [closed]
- List Authors For Current Category
- Show Posts By Custom Field
- Best Way to detect unique posts in wp rest api