$class = 'bg_pattern_' . $img; } } } } if (($img = axiom_get_custom_option('bg_color')) != '') { $style .= 'background-color: ' . $img . ';'; } } } } } ?> <body <?php body_class('axiom_body body_style_' . esc_attr($body_style) . ' body_' . (axiom_get_custom_option('body_filled') == 'yes' ? 'filled' : 'transparent') . ' theme_skin_' . esc_attr($theme_skin) . ' article_style_' . esc_attr($article_style) . ' layout_' . esc_attr($blog_style) . ' template_' . esc_attr(axiom_get_template_name($blog_style)) . ' top_panel_style_' . esc_attr($top_panel_style) . ' top_panel_opacity_' . esc_attr($top_panel_opacity) . ($top_panel_position != 'hide' ? ' top_panel_show top_panel_' . esc_attr($top_panel_position) : '') . ' menu_' . esc_attr(axiom_get_custom_option('menu_align')) . ' user_menu_' . (axiom_get_custom_option('show_menu_user') == 'yes' ? 'show' : 'hide') . ' ' . esc_attr(axiom_get_sidebar_class(axiom_get_custom_option('show_sidebar_main'), axiom_get_custom_option('sidebar_main_position'))) . ($video_bg_show ? ' video_bg_show' : '') . ($class != '' ? ' ' . esc_attr($class) : '')); if ($style != '') { echo ' style="' . esc_attr($style) . '"'; } ?> > <?php do_action('before'); ?> <?php if (axiom_get_custom_option('menu_toc_home') == 'yes') { echo do_shortcode('[trx_anchor id="toc_home" title="" description="' . __('Return to Home', 'axiom') . '" icon="icon-home-1" separator="yes" url="' . home_url() . '"]'); } if (axiom_get_custom_option('menu_toc_top') == 'yes') { echo do_shortcode('[trx_anchor id="toc_top" title="" description="' . __('Back to top', 'axiom') . '" icon="icon-angle-double-up" separator="yes"]');
function axiom_sc_blogger($atts, $content = null) { if (axiom_sc_in_shortcode_blogger(true)) { return ''; } extract(axiom_sc_html_decode(shortcode_atts(array("style" => "regular", "filters" => "no", "post_type" => "post", "ids" => "", "cat" => "", "count" => "3", "columns" => "", "offset" => "", "orderby" => "date", "order" => "desc", "only" => "no", "descr" => "", "readmore" => "", "loadmore" => "no", "location" => "default", "dir" => "horizontal", "hover" => axiom_get_theme_option('hover_style'), "hover_dir" => axiom_get_theme_option('hover_dir'), "scroll" => "no", "controls" => "no", "rating" => "no", "info" => "yes", "links" => "yes", "date_format" => "", "id" => "", "class" => "", "css" => "", "animation" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts))); $css .= axiom_get_css_position_from_values($top, $right, $bottom, $left, $width, $height); $width = axiom_prepare_css_value($width); $height = axiom_prepare_css_value($height); global $post, $AXIOM_GLOBALS; $AXIOM_GLOBALS['sc_blogger_busy'] = true; $AXIOM_GLOBALS['sc_blogger_counter'] = 0; if (empty($id)) { $id = "sc_blogger_" . str_replace('.', '', mt_rand()); } if ($style == 'date' && empty($date_format)) { $date_format = 'd.m+Y'; } if (!empty($ids)) { $posts = explode(',', str_replace(' ', '', $ids)); $count = count($posts); } if ($descr == '') { $descr = axiom_get_custom_option('post_excerpt_maxlength' . ($columns > 1 ? '_masonry' : '')); } if (!axiom_sc_param_is_off($scroll)) { axiom_enqueue_slider(); if (empty($id)) { $id = 'sc_blogger_' . str_replace('.', '', mt_rand()); } } $class = apply_filters('axiom_filter_blog_class', 'sc_blogger' . ' layout_' . esc_attr($style) . ' template_' . esc_attr(axiom_get_template_name($style)) . (!empty($class) ? ' ' . esc_attr($class) : '') . ' ' . esc_attr(axiom_get_template_property($style, 'container_classes')) . ' sc_blogger_' . ($dir == 'vertical' ? 'vertical' : 'horizontal') . (axiom_sc_param_is_on($scroll) && axiom_sc_param_is_on($controls) ? ' sc_scroll_controls sc_scroll_controls_type_top sc_scroll_controls_' . esc_attr($dir) : '') . ($descr == 0 ? ' no_description' : ''), array('style' => $style, 'dir' => $dir, 'descr' => $descr)); $container = apply_filters('axiom_filter_blog_container', axiom_get_template_property($style, 'container'), array('style' => $style, 'dir' => $dir)); $container_start = $container_end = ''; if (!empty($container)) { $container = explode('%s', $container); $container_start = !empty($container[0]) ? $container[0] : ''; $container_end = !empty($container[1]) ? $container[1] : ''; } $output = (strpos($style, 'list') !== 'FALSE' ? '<ul' : '<div') . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="' . esc_attr($class) . '"' . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . '>' . $container_start . ($dir == 'horizontal' && $columns > 1 && axiom_get_template_property($style, 'need_columns') ? '<div class="columns_wrap">' : '') . (axiom_sc_param_is_on($scroll) ? '<div id="' . esc_attr($id) . '_scroll" class="sc_scroll sc_scroll_' . esc_attr($dir) . ' sc_slider_noresize swiper-slider-container scroll-container"' . ' style="' . ($dir == 'vertical' ? 'height:' . ($height != '' ? $height : "230px") . ';' : 'width:' . ($width != '' ? $width . ';' : "100%;")) . '"' . '>' . '<div class="sc_scroll_wrapper swiper-wrapper">' . '<div class="sc_scroll_slide swiper-slide">' : ''); if (axiom_get_template_property($style, 'need_isotope')) { if (!axiom_sc_param_is_off($filters)) { $output .= '<div class="isotope_filters"></div>'; } if ($columns < 1) { $columns = axiom_substr($style, -1); } $output .= '<div class="isotope_wrap" data-columns="' . max(1, min(4, $columns)) . '">'; } $args = array('post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'order' => $order == 'asc' ? 'asc' : 'desc', 'orderby' => 'date'); if ($offset > 0 && empty($ids)) { $args['offset'] = $offset; } $args = axiom_query_add_sort_order($args, $orderby, $order); if (!axiom_sc_param_is_off($only)) { $args = axiom_query_add_filters($args, $only); } $args = axiom_query_add_posts_and_cats($args, $ids, $post_type, $cat); $query = new WP_Query($args); $flt_ids = array(); while ($query->have_posts()) { $query->the_post(); $AXIOM_GLOBALS['sc_blogger_counter']++; $args = array('layout' => $style, 'show' => false, 'number' => $AXIOM_GLOBALS['sc_blogger_counter'], 'add_view_more' => false, 'posts_on_page' => $count > 0 ? $count : $query->found_posts, "location" => $location, "descr" => $descr, "readmore" => $readmore, "loadmore" => $loadmore, "reviews" => axiom_sc_param_is_on($rating), "dir" => $dir, "scroll" => axiom_sc_param_is_on($scroll), "info" => axiom_sc_param_is_on($info), "links" => axiom_sc_param_is_on($links), "orderby" => $orderby, "columns_count" => $columns, "date_format" => $date_format, 'strip_teaser' => false, 'content' => axiom_get_template_property($style, 'need_content'), 'terms_list' => true, 'filters' => axiom_sc_param_is_off($filters) ? '' : $filters, 'hover' => $hover, 'hover_dir' => $hover_dir); $post_data = axiom_get_post_data($args); $output .= axiom_show_post_layout($args, $post_data); if (!axiom_sc_param_is_off($filters)) { if ($filters == 'tags') { // Use tags as filter items if (!empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms)) { foreach ($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms as $tag) { $flt_ids[$tag->term_id] = $tag->name; } } } } } wp_reset_postdata(); // Close isotope wrapper if (axiom_get_template_property($style, 'need_isotope')) { $output .= '</div>'; } // Isotope filters list if (!axiom_sc_param_is_off($filters)) { $filters_list = ''; if ($filters == 'categories') { // Use categories as filter items $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type); $portfolio_parent = $cat ? max(0, axiom_get_parent_taxonomy_by_property($cat, 'show_filters', 'yes', true, $taxonomy)) : 0; $args2 = array('type' => $post_type, 'child_of' => $portfolio_parent, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 0, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => $taxonomy, 'pad_counts' => false); $portfolio_list = get_categories($args2); if (count($portfolio_list) > 0) { $filters_list .= '<a href="#" data-filter="*" class="theme_button active">' . __('All', 'axiom') . '</a>'; foreach ($portfolio_list as $cat) { $filters_list .= '<a href="#" data-filter=".flt_' . esc_attr($cat->term_id) . '" class="theme_button">' . $cat->name . '</a>'; } } } else { // Use tags as filter items if (count($flt_ids) > 0) { $filters_list .= '<a href="#" data-filter="*" class="theme_button active">' . __('All', 'axiom') . '</a>'; foreach ($flt_ids as $flt_id => $flt_name) { $filters_list .= '<a href="#" data-filter=".flt_' . esc_attr($flt_id) . '" class="theme_button">' . $flt_name . '</a>'; } } } if ($filters_list) { $output .= '<script type="text/javascript">' . 'jQuery(document).ready(function () {' . 'jQuery("#' . esc_attr($id) . ' .isotope_filters").append("' . addslashes($filters_list) . '");' . '});' . '</script>'; } } $output .= (axiom_sc_param_is_on($scroll) ? '</div></div><div id="' . esc_attr($id) . '_scroll_bar" class="sc_scroll_bar sc_scroll_bar_' . esc_attr($dir) . ' ' . esc_attr($id) . '_scroll_bar"></div></div>' . (!axiom_sc_param_is_off($controls) ? '<div class="sc_scroll_controls_wrap"><a class="sc_scroll_prev" href="#"></a><a class="sc_scroll_next" href="#"></a></div>' : '') : '') . ($dir == 'horizontal' && $columns > 1 && axiom_get_template_property($style, 'need_columns') ? '</div>' : '') . $container_end . (strpos($style, 'list') !== 'FALSE' ? '</ul>' : '</div>'); // Add template specific scripts and styles do_action('axiom_action_blog_scripts', $style); $AXIOM_GLOBALS['sc_blogger_busy'] = false; if (strpos($style, 'accordion') !== 'FALSE') { axiom_enqueue_script('jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true); } return apply_filters('axiom_shortcode_output', $output, 'trx_blogger', $atts, $content); }