<?php $layout = WPDD_Layouts::get_layout_settings_raw_not_cached($current); $has_loop = is_object($layout) && property_exists($layout, 'has_loop') ? $layout->has_loop : false; $disabled = $has_loop === false ? ' disabled ' : ''; $class = $disabled ? 'post-loops-list-in-layout-editor-alerted' : ''; ?> <?php if (count($loops) > 0) { ?> <div class="js-change-wrap-box"> <h2 class="js-change-layout-use-section-title change-layout-use-section-title-outer"><span class="change-layout-use-section-title js-collapse-group-individual"><?php _e('Archives:', 'ddl-layouts'); ?> </span> <i class="icon-caret-down js-collapse-group-in-dialog change-layout-use-section-title-icon-collapse"></i></h2> <ul class="hidden post-types-list-in-layout-editor js-post-types-list-in-layout-editor js-change-layout-use-section change-layout-use-section <?php echo $class; ?> "> <li> <div class="alert-no-loops toolset-alert <?php if ($has_loop) { ?> hidden<?php } ?> "> <!-- <i class="icon-remove js-remove-alert-message remove-alert-message" data-has_right_cell="<?php
function before_header_hook() { if (isset($_GET['layout_id'])) { $layout_selected = $_GET['layout_id']; } else { $post_id = get_the_ID(); $layout_selected = WPDD_Layouts::get_layout_settings($post_id, false); } if ($layout_selected > 0) { //$layout_content = get_post_meta($layout_selected, WPDDL_LAYOUTS_SETTINGS); $layout_content = WPDD_Layouts::get_layout_settings_raw_not_cached($layout_selected, false); if (sizeof($layout_content) > 0) { $test = new WPDD_json2layout(); $layout = $test->json_decode($layout_content[0]); $manager = new WPDD_layout_render_manager($layout); $renderer = $manager->get_renderer(); $html = $renderer->render_to_html(); echo $html; } } }