Support

Account

Home Forums Front-end Issues Nothing Displays on Frontend Reply To: Nothing Displays on Frontend

  • All templates for showing single posts must have “The Loop” https://codex.wordpress.org/The_Loop, looking at the first bit of code you posted I am assuming that you do not have this. No, it does not make a hellofalotta sense when there is only one post, but this is WP.

    If you do not have “The Loop” or you want to show fields outside of “The Loop” then you must supply the post ID when using ACF.

    
    // example when using "The Loop"
    if (have_posts()) {
      while (have_posts()) {
        the_post();
        the_field('your-field-name');
      }
    }
    
    
    // example when not in "The Loop"
    $queried_object = get_queried_object();
    $post_id = $queried_object->ID;
    the_field('your-field-name', $post_id);