function the_modules_loop($modules_field = 'modules') { // Loop through rows of flexible content field while (the_flexible_field($modules_field)) { // Render module template based on the row layout's name $module_name = str_replace('_', '-', get_row_layout()); the_module($module_name); } }
} ?> <div class="<?php echo $layout == '1' ? 'large-12' : 'large-8'; ?> columns"> <?php //the_content(); ?> <?php $count == 0; $row_shortcode = ""; ?> <?php while (the_flexible_field("videos")) { ?> <?php if (get_row_layout() == "video_galey") { // layout: Content ?> <?php //image gallery variables $title = get_sub_field("title"); $icon = get_sub_field("icon"); $url = get_sub_field("url"); $description = get_sub_field("dscription"); //start row if ($count % 3 == 0) { $row_shortcode = '[row]'; }
<meta name="viewport" content="width=device-width, initial-scale=1"> <?php wp_head(); ?> </head> <body <?php body_class(); ?> > <?php while (have_posts()) { the_post(); // Check if ACF is enabled and the modules field exists if (function_exists('get_field') && get_field('modules') !== null) { // Loop through rows of flexible content field while (the_flexible_field('modules')) { // Render module template based on the row layout's name $module_name = str_replace('_', '-', get_row_layout()); // Use "include(locate_template(...))" instead of "get_template_part" to retain scope include locate_template("/modules/{$module_name}/{$module_name}.php"); } } else { // Standard post content the_title('<h1>', '</h1>'); the_content(); } } ?> <?php wp_footer(); ?>
<?php while (the_flexible_field("page_content")) { if (get_row_layout() == "general_content") { ?> <div class="pgwp-content"> <?php the_sub_field('content'); ?> </div> <?php } elseif (get_row_layout() == "video") { ?> <div class="video-player-wrap clearfix"> <?php $vscreen = get_sub_field('video_screenshot'); ?> <div class="video-player pull-left" style="background-image:url(<?php if (isset($img['sizes']['team'])) { echo $img['sizes']['team']; } ?> )"> <a href="#"><div class="play-btn"><span>▶</span></div></a> </div> <div class="video-title pull-right"> <?php
<?php while (the_flexible_field("bottom_content")) { if (get_row_layout() == "thought_leadership") { ?> <?php $layout = get_sub_field('layout'); if ($layout == 'simple') { ?> <section id="pg-leadership"> <div class="container"> <div class="container-inner clearfix"> <div class="col-one pull-left"> <h2 class="lrg-head-line">thought leadership</h2> </div> <div class="col-two pull-left"> <ul> <li> <a href="#"><p>Garbage In, Garbage Out: An Optical Tour of the Role of Strategy in Venue Analysis</p></a> <span class="date">October 2, 2014 </span> <a class="name" href="#">Ian Domowitz</a> </li> <li> <a href="#"><p>Measuring the Trading Activity at the Open and Close Auctions Around the Globe</p></a> <span class="date">October 2, 2014</span> <a class="name" href="#">Milan Borkovec</a> </li> </ul> </div> </div> </div> </section>
} ?> <!-- end flexible fields --> </div> <?php } elseif (get_field('header_layout', 'option') == "nav_overlay") { ?> <div class="wide-container home-head"> <?get_template_part('inc/nav','dark');?> <?php while (the_flexible_field("home_banner_options")) { ?> <?php if (get_row_layout() == "slider") { // layout: Main Content with bg image ?> <div class="header-content"> <ul class="bxslider slider-header"> <?php if (get_sub_field('slider_images')) { ?> <?php while (has_sub_field('slider_images')) { ?> <?php
<?php while (the_flexible_field("content_sections")) { ?> <?php if (get_row_layout() == "main_content") { // layout: Main Content with bg image ?> <div class="wide-container content-section main-content-section"> <div class="container"> <div class="row"> <div class="col span_24"> <p><?php the_sub_field("content"); ?> </p> </div> </div> </div> </div> <?php } elseif (get_row_layout() == "featured_fundraiser_embeds") { // layout: Intro with Call to Action ?> <div class="wide-container content-section" style="color:<?php the_sub_field('font_color'); ?> ;background: <?php the_sub_field('background_color');
<?php while (the_flexible_field("general_content", $P)) { if (get_row_layout() == "content_with_image_on_right") { ?> <div class="col-md-12"> <div class="col-md-6"> <?php the_sub_field('content'); ?> </div> <div class="col-md-6"> <?php $img = get_sub_field('image'); ?> <?php if (isset($img['sizes']['side-img'])) { ?> <div class="border-img"> <img src="<?php echo $img['sizes']['side-img']; ?> " alt="<?php echo $img['alt']; ?> " class="img-responsive" /> </div> <?php }
the_sub_field('title'); ?> </a></li> <?php } ?> </ul> <a href="#">About</a> <a href="#">Contact</a> </aside> <content class="main <?php the_sub_field('title'); ?> "> <?php while (the_flexible_field('project')) { ?> <article style="display: none" data-project="<?php the_sub_field('title'); ?> "> <?php the_sub_field('content'); ?> <aside class="sidebar-secondary"> <ul> <li class="title"><?php the_sub_field('title'); ?> </li> <li class="agency"><?php
<?php if (get_field('blocks')) { while (the_flexible_field("blocks")) { ?> <section class="block <?php echo strtolower(str_replace('_', '-', get_row_layout())); ?> <?php the_sub_field('background_class'); ?> "<?php if (get_sub_field('background_class') == 'image') { ?> style="background-image: url(<?php $background_image = get_sub_field('background_image'); echo $background_image['url']; ?> );"<?php } ?> > <?php get_template_part('parts/' . strtolower(str_replace('_', '-', get_row_layout()))); ?> </section> <?php
</div> </header> <?php if (get_field("logo_color")) { ?> <style>.site-title a{background: url(/wp-content/themes/little_rectangle/images/little-rectangle-<?php echo get_field("logo_color"); ?> .png) no-repeat;}</style> <?php } ?> <?php while (the_flexible_field("stripes")) { ?> <?php get_template_part('stripe', get_row_layout()); ?> <?php } ?> <?php little_rectangle_content_nav('nav-below'); ?> <?php
} ?> <div class="<?php echo $layout == '1' ? 'large-12' : 'large-8'; ?> columns"> <?php //the_content(); ?> <?php $count == 0; $row_shortcode = ""; ?> <?php while (the_flexible_field("album")) { ?> <?php if (get_row_layout() == "photo_album") { // layout: Content ?> <?php //image gallery variables $title = get_sub_field("title"); $icon = get_sub_field("icon"); $short_code = get_sub_field("gallery_short_code"); $description = get_sub_field("description"); //start row if ($count % 3 == 0) { $row_shortcode = '[row]'; }
</div> <?php } } ?> </div> </div> </div> <div class="col-md-1"> </div> <div class="col-md-4"> <div id="sidebar"> <?php while (the_flexible_field("tab_sidebar_modules")) { if (get_row_layout() == "general_content") { ?> <?php if ($img = get_sub_field('top_image')) { ?> <div class="menu-image"> <img src="<?php echo $img['sizes']['side-bar-menu']; ?> " alt="<?php echo $img['alt']; ?>
/** * Outputs the Grav Blocks * * @param string $args - Currently the two options for the array are 'section' and 'object' * * @return type */ public static function display($args = array()) { // Check $args array if it exists and what is set. $section = !empty($args) && isset($args['section']) ? $args['section'] : 'grav_blocks'; $object = !empty($args) && isset($args['object']) ? $args['object'] : false; $query_target = $object ? $object : (($query = get_queried_object()) && !empty($query->term_id) ? $query : ''); if (self::is_viewable()) { $handler_file = self::get_path('handler.php'); self::$block_index = 0; if ($handler_file && get_field($section, $query_target)) { while (the_flexible_field($section, $query_target)) { self::$block_index++; $block_class_prefix = 'block'; $unique_id = GRAV_BLOCKS_PLUGIN_SETTINGS::is_setting_checked('advanced_options', 'add_unique_id') && ($uid = get_sub_field('unique_id')) ? 'id=' . sanitize_title($uid) . '' : ''; self::$current_block_name = strtolower(str_replace('_', '-', get_row_layout())); $block_background = ($block_bg = get_sub_field('block_background')) ? $block_bg : 'block-bg-none'; if (!empty(self::$settings['background_colors'])) { foreach (self::$settings['background_colors'] as $color_key => $color_params) { $use_css_variable = !empty($color_params['class']) && GRAV_BLOCKS_PLUGIN_SETTINGS::is_setting_checked('css_options', 'add_custom_color_class'); if (!empty($color_params['_repeater_id']) && $block_background === 'block-bg-' . $color_params['_repeater_id'] && $use_css_variable) { if (!GRAV_BLOCKS_PLUGIN_SETTINGS::is_setting_checked('css_options', 'enqueue_css')) { $block_background = ''; } $block_background .= ' ' . $color_params['class']; } } } $block_background_image = get_sub_field('block_background_image'); $block_background_image_url = $block_background_image['url']; $block_section_attributes = ''; $block_background_style = $block_background === 'block-bg-image' && $block_background_image ? ' background-image: url(\'' . $block_background_image_url . '\'); ' : ''; if (GRAV_BLOCKS_PLUGIN_SETTINGS::is_setting_checked('advanced_options', 'add_responsive_img')) { if ($block_background === 'block-bg-image') { $block_section_attributes = GRAV_BLOCKS::image_sources($block_background_image); $block_background_style = ''; } } include $handler_file; } } } }
<?php global $P; while (the_flexible_field("modules", $P)) { if (get_row_layout() == "three_column_content") { ?> <!-- Features Section --> <section class="features-intro border"> <!-- Page Content --> <div class="container"> <!-- Marketing Icons Section --> <div class="row"> <?php while (has_sub_field('three_column_module', 'options')) { ?> <div class="col-md-4"> <div class="panel panel-default"> <div class="wow fadeInUp center" data-wow-delay="0.1s"> <div class="panel-image"> <?php $timg = get_sub_field('threecol_image', 'options'); ?> <?php if (isset($timg['sizes']['threecol-img'])) { ?> <img src="<?php echo $timg['sizes']['threecol-img']; ?> " alt="<?php
</form> --> </div> </div> <div class="site-banner has-padding-right-left has-no-padding-top-bottom text-center"> <a href="<?php echo get_site_url(); ?> /informations-pratiques/grille-dautonomie/" class="button uppercase color-white background-light-grey-05 font-size-16 display-inline-block"> Calculez votre niveau d'autonomie </a> </div> <?php while (the_flexible_field("home_block")) { ?> <?php if (get_row_layout() == "block_simple") { // layout: Block Simple ?> <div class="site-banner background-<?php the_sub_field('block_simple_background'); ?> has-padding text-center"> <h2 class="h1 uppercase has-under-dash-center color-dark-blue-04"> <?php the_sub_field("block_simple_title"); ?>
?> </a></p> <?php } ?> </div> </div> </div> </div> <?php while (the_flexible_field("work_content")) { ?> <?php if (get_row_layout() == "1col") { ?> <div class="work-content--block"> <div class="work-content"> <div class="work-content--1col"> <?php the_sub_field("full_column_1col"); ?> </div> </div> </div> <?php