Solved. I had a typo – line 10:
$post_object = get_field('post_object');
should have had the name of my post object field ie:
$post_object = get_field('myfieldname');
Related Posts:
- How can I add multiple ‘tax_query’ arrays via a loop?
- ACF page while loop breaks footer while loop
- Using Advanced Custom Fields to create a per page slider
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Add class to every other posts using get_posts
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- ACF – Get ID of relationship field in flexible content
- How to output values from a loop into a javascript array
- ACF background-color per post in a WordPress loop
- PHP for loop not working as intended
- Create a hierarchical loop at predefined markup requirements
- ACF loop and php formatting
- Transient Loop Not working as expected
- the_post_thumbnail unless video id is added
- Blog posts repeat
- How to use thumbnail size of image if I’m only using src to get image
- Slick + PHP + ACF + JQuery slide reveal not working
- How to add condition in wordpress loop? [closed]
- Open post-content in archive page in a Modal box with bootstrap
- Woocommerce : Can’t get product info in loop
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- Alert Bar section within WP loop is displaying even though there are no posts
- remove post that has no content
- Display category name only once inside loop
- Can’t find infinite loop cause
- Checking array against author id in loop
- How do I Turn This Into An if statement?
- Query if audio attachment AND/OR custom field
- Stuck in the query loop
- Load wordpress content in other domain
- How do I get post attachments in menu_order in WordPress?
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Checkbox doesn’t stay checked, conten
- Sort by page information by Ascending Numbers
- post thumbnail, conditions, else wont work
- Widgets in the loop if active
- List posts that don’t have a specific tag?
- Changing the_posts_navigation() html output
- Can we count the WordPress Loop
- Advanced Custom Fields – display label and value only if value entered
- Get post id within comments loop
- Advanced Custom Fields not displaying
- Syntax error when I try to insert my loop into an unordered list? [closed]
- WP_Query fails despite having 1 post
- PHP Syntax Error on get_posts
- Add content after the first post in WP Loop
- wp_query get the 2nd post
- Loop stopped working
- Download PDF after CF7 form submission
- How to get post ID in a Page?
- Custom Pagination is Broken
- Display an image if odd number of posts in grid
- How to loop through all the attached images in a post, and get their url one by one
- How i can get post data from database when i am getting post id from url in wordpress
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Output meta into arrays
- Store post content in a php variable and output them using for loop
- How to add div blocks after certain set of post
- Echo a shortcode div after every 3 posts
- How to avoid duplicates when creating recent network posts
- How to overwrite orderby with add_query_var
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Why in my theme I can’t see all the statics content under the posts?
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- How to retrive the text : No movie by this actor
- Is the 404 page automatically displayed if a loop returns nothing?
- How do I remove a category from a wordpress loop>
- variable value disappears in a second loop
- Last class on last headline?
- Show recent posts starting at a specific number archive
- Upload non-featured image to image field
- get_the_ID() in the footer returns wrong value
- How to get the last category name of a child category?
- HTML Special Characters in URL string [closed]
- ACF put a comma after the last repeater field value [closed]
- WordPress query undefined offset in loop
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Form search query – displaying ACF “Post Object” field as results
- InnerBlocks with allowedBlocks not working with acf_register_block
- How to unlink all posts from tracking same amount of views
- Issue with custom loop in Archive page
- Accessing values from ACF sub field (flexible content area) in PHP
- Creating an image from a custom field
- Can I set up a hover animation in CSS depending on a PHP conditional?
- Get ACF options field in PHP acting as CSS
- Why my loop isn’t working? [closed]
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- ACF & Bootstrap Gallery Shows Blank Slides [closed]
- use loop to return blog details
- Conditional multidimensional arrays and array_map
- ACF Repeater Pagination stopped working since upgrade to php7.2
- How can I count ACF sub_field with a certain value
- How to get current post category details inside “loop”?
- How to pass current loop data into nested loop