if(!get_field('afbeelding_onder'))
{
$prev_post = get_previous_post();
echo '<p>' . get_field('afbeelding_onder', $prev_post->ID) . '</p>';
}
else
{
echo '<p>' . get_field('afbeelding_onder') . '</p>';
}
not tested. you might want to include a while loop, if the previous post does also not have that value set?
Related Posts:
- How set featured posts using checkbox in post edit screen?
- get_post_custom stripping styling issue
- How to get Advanced Custom Field Value According using POST ID? [closed]
- Guest Author – How to display posts on /author/ archive page
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- ACF to select posts not displaying on blog page
- Saving Post Data in Another Database
- How to display post list in a table layout (multiple queries in single loop)
- WP_Query custom field pass the post id
- ACF flexible content block not showing on live site (works locally)
- Only the most recent post is showing on my category page (working on localhost, not live site)
- 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
- WordPress Request Post All Post ID in a Loop? [closed]
- Auto populate custom fields by post date
- ACF Relationship – Get Parent’s Post Object
- How do I show the post title if an advanced custom field hasn’t been used?
- How to make a local “scroll to ID” on post?
- Custom post order returning posts from other categories
- How to detect if an ACF custom-field is really in use?
- Get Value of Post before
- why does wordpress ignore the post args?
- Multiple Loops Breaking Pages
- add to end of post in the loop with plugin
- How to rate a post from Admin Side / Manually?
- First x post with another template then the others
- Loop doesn’t show title of second post and posts thereafter
- Customize rel=canonical tag for single blog post
- Change all author links in Blog roll
- How to I retrieve the ID from the Posts page?
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Showing categories and subcategories with posts
- Second get_permalink inside loop points to wrong URL
- Get the amount of posts on a current page
- Loop parent terms {display posts} AND loop child terms {display posts}
- How to add a class to each individual post?
- add bootstrap post slider with tabs
- How to add add more properties to WP_Post object in search results loop
- Get post ID from a link
- Custom taxonomy archive page problem
- Create a list of posts with topic headdings
- Add field to user meta table in database when link is clicked
- Hide custom metabox value from custom fields
- Loop don’t work within single.php page
- Use Click Image to Play Youtube Video in a WordPress Loop
- Get post meta retrieving wrong value
- older blog posts not showing in new theme
- How to get posts published on the latest date?
- The_excerpt() doesn’t parse – how to change that?
- Trying to edit archive.php to only show post extract, with featured image
- Add Blog to WP homepage Manually
- How can I remove the first two words and shorten get_the_title()
- How to only publish posts with image in it
- How to show all posts by author on buddypress profile with navigation
- Page and post loop same template
- WordPress Query Posts From Category Post on Static Page
- Edit multiple custom post types while saving a new or edited post
- Add custom text automatically on each post
- Getting blog pagination to work on page set as front page
- Extracting relevant tags associated with that particular single post only
- Make loop inside slider divisible [closed]
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- Why this function doesn’t works without the_post?
- if in category but only with post meta
- Display current post position in Elementor Posts widget
- Getting property of non-object when looping through post objects from ACF
- Update post meta within save_post action
- Loop through posts? Want to remove extra newlines in actual post HTML/content on backend
- Output Post with ACF Fields into other Post
- WP_Query: Show 10 posts in date order, first three random
- How include css class based on post ( in loop ) slug?
- ul list with only as many li’s as filled custom fields
- WordPress Loop: How to display recent posts in multiple divs
- Add hero image to home page (blog format) via the dashboard
- Querying another post category to match current post and display in loop
- Add two custom fields as a default to the “new post” page.
- How to display posts on custom page without declaring a posts page in reading settings?
- Show posts by quarter
- separate the post of a category by subcategory
- After ajax image is outside the “ tag
- Edit custom fields in posts list
- Add multiple meta keys to a post at once
- Cannot implement byline into posts container in single.php
- Not all posts showing in query
- how to handle the loop using filling bootstrap grid structure?
- Optimizing the blog loop
- How to check if there are posts with the same tag
- WordPress loop not working on static front page
- Accessing Post ID Within Loop
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Some doubts about how the loop work (trying debugging it)
- Custom WP_Query not working correctly
- Different number of posts per row in grid layout
- Optimize CPT-function with a loop
- Display specific posts on home page
- The loop starting at a certain ID
- linking to post outside the loop
- WP_Query of Category Not Showing First Post
- Cant’ Grab WordPress Built-in Posts Through Loop
- saving/reading custom field value does not work – no value gets POSTed