Home Forums Add-ons Flexible Content Field New flexible content layout not displaying on front-end


New flexible content layout not displaying on front-end

  • I have added a new layout to a flexible content block, but for some reason it isn’t displaying on the page as it should. Previous layouts that have been created are displaying fine and the layout I have created is showing up in the back-end as it should.

    Here are my settings for the layout:

    Here is the code for my index.php page:

    <?php get_header(); ?>

    <?php if(have_posts()){

    $header_type = get_field( ‘header_type’ );
    get_template_part(‘templates/header’, $header_type);
    $layout = get_row_layout();
    get_template_part(‘templates/flex’, $layout);
    } ?>

    <?php get_footer(); ?>

    and here is the code for my layout:

    <div class=”full-width-image-block” style=”background-image:url(<?php if( get_sub_field( ‘full-width-image’ ) ){ the_sub_field( ‘full-width-image’ ); } ?>) ;”>
    <div class=”page-width”>
    <?php if( get_sub_field( ‘heading’ ) ){ ?>
    <p class=”large-text”><?php the_sub_field( ‘heading’ ); ?></p>
    <?php } ?>

    The layout template is named “flex-full-width-image-block” so it should be picked up correctly, but I can’t seem to work out why its not displaying.

    FYI, max_vars is set to 3000. Any help appreciated. Thanks in advance.

  • Solved – was a typo in the end.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘New flexible content layout not displaying on front-end’ is closed to new replies.