Support

Account

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

Solved

New flexible content layout not displaying on front-end

    • NewMike

    • September 28, 2018 at 11:52 pm

    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:
    https://i.stack.imgur.com/cjPnr.png

    Here is the code for my index.php page:

    <?php get_header(); ?>

    <?php if(have_posts()){

    while(have_posts()){
    the_post();
    $header_type = get_field( ‘header_type’ );
    get_template_part(‘templates/header’, $header_type);
    if(have_rows(‘flexible_content’)){
    while(have_rows(‘flexible_content’)){
    the_row();
    $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 } ?>
    </div>
    </div>

    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.

    • NewMike

    • September 29, 2018 at 1:15 am

    Solved – was a typo in the end.

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.