Because you’re in The Loop, you shouldn’t need to use get_the_ID()
. Does this:
<div class="latest">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="boxes"> <?php echo "<p>".the_meta()."</p>"; ?>
<a href="https://wordpress.stackexchange.com/questions/109423/<?php echo get_post_meta($post->ID,"promotional_link', true); ?>">
<?php //var_dump($show); ?>
<img src="<?php echo get_post_meta( $post->ID, 'promotional_image', true); ?>" height="200" width="260">
</a>
</div><!--boxes-->
</div>
<?php endwhile; endif; ?>
work any better?
Related Posts:
- Order posts by custom field and if custom field is empty return remaining posts
- Calling Specific Pages with wp query Part II
- Loop through two different sets of custom fields
- Displaying Custom Fields on Post with Genesis Child Theme
- How do I exclude posts by custom field value?
- Echo values from custom field outside loop php
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Calling custom fields for pages (not posts)
- Duplicate posts being displayed when querying Custom Fields
- Loop to display random posts only if a custom field matches category
- How can I show custom fields in the loop only to specific user roles?
- get_posts that match a user-specified value on a page
- Accessing loop functions (e.g the_title or the_content) from post ID
- Limit the number of acf content when displaying in post loop [closed]
- Is there a better way to list all database terms alphabetically?
- Change the main loop WordPress impact on the server?
- custom-meta-box checkboxes from loop won’t save
- How to show a post if was published less than two hours ago?
- List users by sum of all their posts’ custom field values
- Custom Fields – How to create a list from multi-line entries of a single value
- how to make nsfw post with thumbanil
- Custom Query based on custom field of a single post
- Efficiently sort only certain categories by custom field
- Can I access a post meta field before the loop?
- Displaying page image in the footer automatically
- Show image if author meta (profile fields) exists outside loop
- Can’t query by meta_key
- ul list with only as many li’s as filled custom fields
- Loop through incrementing custom fields
- do_shortcode close
- Search Results Page – Displaying Custom Meta Fields
- Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
- Collect Data from NEXT item while in loop
- How to show content of custom fields in search results?
- Custom field outside the loop and inside an array
- Display metabox title for custom fields with values
- use custom field value as post category in loop
- Filter or order based on custom field
- Compare ACF date field (if exists) and post date and order DESC
- What am I missing in this Code Block?
- get_field values for each post on home page using wp_add_inline_style
- How to display custom fields in hestia theme
- trying to add extra field using hooks
- User Filter Options on Archive Page
- Custom meta boxes – add php code inside?
- get wordpress post loop by meta box date
- Outputting custom field on home.php not outside of blog list
- Counting number of images from loop
- Metabox value for post loop?
- Get meta value when the page is a blog archive
- WP_query returns error when used for custom widget
- I want my post to republish again after adding a custom field
- Display posts where date field matches current month?
- Filtering posts by WORD in custom field
- Retrieve IDs from custom field, count and display results differently according to count
- Pagination not displaying correct number of pages
- Display custom field outside the loop
- Order by a meta field in query loop
- Is there a way to set default custom fields when creating a post?
- How set featured posts using checkbox in post edit screen?
- So much data in postmeta
- Show only posts which can be commented OR have custom meta field
- Show Custom Comment Fields when editing in admin
- How do I make a custom field choose an image?
- get_post_meta() unserialize issue – returns boolean(false)
- Edit Custom Database Tables in WordPress
- Gutenberg Custom Block
- Up/Down voting system for WordPress
- Custom Meta Field not Working with qTranslate [closed]
- Change content before writing to database
- post meta data clearing on autosave
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Add description text under input field for new profile fields
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Get all posts that do not have a specific custom field without using a subquery
- How to query posts with certain custom meta data, and output Post data
- Custom Fields Not in Search Results
- add_action and remove_action if custom field exists
- Store array as single, serialized post meta field or many post meta fields?
- Get an advanced custom field after post publish
- update_post_meta for repeated custom field [closed]
- Delete custom fields when deleting posts
- Pull custom fields from custom posts within a loop
- Ordering posts by custom field named “date” in backend
- How to display custom fields from a plugin
- Adding “meta” info to WP site PHP function?
- WordPress Media Uploader custom Javascript not working
- List custom queried terms in the edit-tags.php?taxonomy page
- Display meta box dropdown (from custom post type) in the page post type
- No result update a custom field using wp_schedule_event
- Display custom widget value in header.php
- wpdb function insert doesn’t work
- Login_form add to top of form rather then bottom
- Search one custom field?
- Can’t save meta field value if the title not set
- Get a different meta value with ajax when different elements are clicked
- How do you turn a custom field’s value into a permalink for that post?
- How to keep sharing stats after creating 301 redirects?
- Using Hooks. Thematic
- Update field name without losing the value