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?
- How to check if post meta key exists or not in wordpress database
- Update all posts automatically when using post_meta
- List only child categories a post is in, of a specific parent category
- Setting post meta data to random value during post status transition / on publish
- Can’t show comments count per post outside loop
- How to change post status from publish to draft using hook in wordpress?
- Alternate custom content in the loop
- Allow role to delete posts but block him the wp-admin
- WP_Query in functions.php overrides global $post object, even with wp_reset_query()
- Auto Refresh Post List after X seconds
- Display posts with comments closed, with pagination?
- What Is meta_id In wp_postmeta?
- Prepend or add an Image to the content of a Post
- Why content_arr[‘extended’] removes paragraph tags?
- How To Get Posts With A Specific Word
- How to display posts on a static page? (like search loop)
- Why WP_Query(‘showposts=5’) shows only 1 post?
- problems with loading posts in a table-row
- Blog page pagination is not working after using the offset argument
- WP Query – Posts Per Page not working in combination with category__in
- More then one menu items are assigned with “current-menu-item” class
- Shortcode not working with post counter
- Display post x of y within category
- WordPress Automatic Filename Changer
- How to add tags (custom taxonomy) to post class css?
- Listing Specific Categories from Current Post with Depth
- get_the_category listing in hierarchial order
- How to automate featured posts number? [duplicate]
- Exclude current custom post on single post
- How to save meta checkbox WordPress
- How to add add more properties to WP_Post object in search results loop
- Custom taxonomy archive page problem
- Loop don’t work within single.php page
- How to show all posts by author on buddypress profile with navigation
- Getting blog pagination to work on page set as front page
- Make loop inside slider divisible [closed]
- Update post meta within save_post action
- Getting Whitescreen when publishing a post [closed]
- Custom permalink for each post
- Is there a way getting post fields using `transition_post_status`
- How to display post list in a table layout (multiple queries in single loop)
- Not all posts showing in query
- Related Posts: Changing Function For Posts Per Page
- Display 3 posts with different HTML markup using a loop
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- How to repeat a loop after 4 posts [duplicate]
- How to separate each individual blog post?
- Is there a way to define the $post var outside the loop?
- Set Default Post as Parent Child (Nested) Relation
- Only the most recent post is showing on my category page (working on localhost, not live site)
- Featured Images most often doesnt appear
- I want to change the WordPress comments file
- subtracting the current post form then whole loop, which is generating all CPT titles
- Excluding tag Link from html tags in Post content
- Changing a users posts to drafts upon role change
- Can I Paginate Post after every 25 tag?
- Alternative content between posts no repetition
- Start loop from specific post ID
- Display new posts categories in separated divs
- Trim excerpt to first paragraph
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- WordPress loop uses unmodified posts array, why?
- Add row after three columns
- Modify WordPress loop after it has been run
- Skip posts, but keep posts per page
- Show posts between two Custom Fields date
- index.php is only displaying current month’s posts?
- Ordering posts alphabetically by meta keys and title
- Loop doesn’t display posts. It displays a link to the home page instead
- Grab next post title in archive page
- Getting posts from multiple users?
- Show post if in category
- Displaying categories items among posts
- Related posts by searching post tags of single post as terms
- Show all posts in category
- First post in loop displays twice
- If meta_key exists then don’t select this post?
- Show Next/Previous without Link
- Filters do not work when there are multiple (one works)
- WordPress Ajax load doesn’t work