<?php $title = wp_sb_get_field_value('title'); if (isset($title['_css'])) { wp_sb_template()->add_css('.' . $section_id . ' .post-heading', $title['_css']); } ?> <h1<?php wp_sb_editing_field('title'); ?> class="post-heading"><?php echo $title['label']; ?> </h1> <?php $btn = wp_sb_get_field_value('button'); $classes = array($btn['button_style'], $btn['size']); ?> <p><a<?php wp_sb_editing_field('button'); ?> href="#" class="btn <?php echo esc_attr(join(' ', $classes)); ?> "><?php echo $btn['label']; ?> </a></p> </div> </div>
<h1<?php wp_sb_editing_field('title'); ?> ><?php echo esc_html(wp_sb_get_field_value('title')); ?> </h1> <p<?php wp_sb_editing_field('tagline'); ?> ><?php echo esc_html(wp_sb_get_field_value('tagline')); ?> </p> <div<?php wp_sb_editing_field('contents'); ?> > <?php $contents = wp_sb_get_field_value('contents'); $backup_values = $section_values; $backup_section = $current_section; $backup_settings = $section_settings; // var_dump( $current_section ); global $wp_sb_elements; // var_dump( $contents ); foreach ($contents as $_block) { if (!isset($_block['tag'])) { continue; } $GLOBALS['current_section'] = $wp_sb_elements[$_block['tag']];
<?php $settings = array('tag' => 'header-1', 'fields' => array('title' => array('type' => 'inline', 'default' => 'Hello, world!'), 'tagline' => array('type' => 'inline', 'default' => 'Hello, world!'), 'button' => array('type' => 'button', 'default' => 'Hello, world!')), 'settings' => array('bg' => array('img_url' => '', 'img_id' => '', 'bg_color' => '', 'bg_type' => ''), 'content_box' => array('bg_color' => '', 'opacity' => '', 'text_color' => ''), 'typography' => array('font' => '', 'size' => '', 'color' => ''), 'align' => 'left')); ?> <div class="section"<?php wp_sb_editing_section($settings); ?> > <div class="container"> <h1<?php wp_sb_editing_field('title'); ?> >Hello, world!</h1> <p<?php wp_sb_editing_field('title'); ?> >This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p> <p><a<?php wp_sb_editing_field('button', array('button_style' => 'btn-primary', 'size' => 'btn-lg')); ?> href="#" class="btn btn-primary btn-lg">Learn more »</a></p> </div> </div>