<?php // chcek if (empty($toggles)) { return; } $count = 0; $tabs_content = ''; foreach ($toggles as $tab) { ++$count; $active = $count == 1 ? ' active' : ''; $tabs_content .= '<section class="toggle' . $active . '"><label>' . $tab['title'] . '</label><div class="toggle-content">'; // content if (isset($tab['bucket'])) { $args = array('post_type' => 'bucket', 'p' => $tab['bucket']); $query = new WP_Query($args); while ($query->have_posts()) { $query->the_post(); $tabs_content .= spyropress_get_the_content(); } } else { $tabs_content .= apply_filters('the_content', $tab['content']); } $tabs_content .= '</div></section>'; } wp_reset_query(); if ('one' == $template) { echo str_replace('toogle">', 'toggle" data-plugin-toggle data-plugin-options=\'{ "isAccordion": true }\'>', $before_widget) . $tabs_content . $after_widget; } else { echo str_replace('>', ' data-plugin-toggle>', $before_widget) . $tabs_content . $after_widget; }
/** * the_content */ function spyropress_the_content($post_id = '') { echo spyropress_get_the_content($post_id); }
get_template_part('templates/slider'); get_template_part('templates/top', 'page'); ?> <div id="post-<?php the_ID(); ?> " <?php post_class('container'); ?> > <div class="row"> <div class="col-md-9"> <?php spyropress_before_post_content(); echo str_replace('class="container"', 'class="container-null"', spyropress_get_the_content()); wp_link_pages(array('before' => '<div class="page-link">' . __('Pages:', 'spyropress'), 'after' => '</div>')); spyropress_after_post_content(); ?> </div> <div class="col-md-3"> <aside class="sidebar"> <?php dynamic_sidebar('page'); ?> </aside> </div> </div> </div>
} global $accordion_ids, $spyropress_tab_counter; $count = isset($is_active) && $is_active ? 1 : 0; $content = ''; ++$accordion_ids; foreach ($accordions as $tab) { ++$count; ++$spyropress_tab_counter; $active = $count == 1 ? ' in' : ''; // content if (isset($tab['bucket']) && !empty($tab['bucket'])) { $args = array('post_type' => 'bucket', 'p' => $tab['bucket']); $query = new WP_Query($args); while ($query->have_posts()) { $query->the_post(); $xcontent = spyropress_get_the_content(); } wp_reset_query(); } else { $xcontent = do_shortcode($tab['content']); } $icon = isset($tab['icon']) ? '<i class="fa ' . $tab['icon'] . '"></i> ' : ''; $content .= ' <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion' . $accordion_ids . '" href="#collapse' . $spyropress_tab_counter . '"> ' . $icon . $tab['title'] . ' </a> </h4> </div>