Support

Account

Home Forums Front-end Issues content in custom fields not showing on live page Reply To: content in custom fields not showing on live page

  • I can’t say for certain if this is the issue but you have an outer loop which is the main loop and holds the Global $post object. You then have an inner loop with a foreach(). Whenever you call the_field() it will always pull from the Global $post object unless told otherwise. Your foreach() doesn’t overwrite this ( you would need to use setup_postdata( $slide ) ).

    The solution could be, assuming you want to pull field values from the get_posts() results is to pass the post or post ID into the function call like so:

    the_field( 'main_slide_title', $slide )

    or

    the_field( 'main_slide_title', $slide->ID )