Пример #1
1
 /**
  * How to display the widget on the screen.
  */
 function widget($args, $instance)
 {
     extract($args);
     global $wp_query, $post;
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
     $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post';
     $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type);
     $number = isset($instance['number']) ? (int) $instance['number'] : '';
     $show_date = isset($instance['show_date']) ? (int) $instance['show_date'] : 0;
     $show_image = isset($instance['show_image']) ? (int) $instance['show_image'] : 0;
     $show_author = isset($instance['show_author']) ? (int) $instance['show_author'] : 0;
     $show_counters = isset($instance['show_counters']) && $instance['show_counters'] > 0 ? axiom_get_theme_option('blog_counters') : '';
     $category = isset($instance['category']) ? (int) $instance['category'] : 0;
     $output = '';
     $args = array('numberposts' => $number, 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => $post_type, 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'ignore_sticky_posts' => 1, 'suppress_filters' => true);
     if ($category > 0) {
         if ($taxonomy == 'category') {
             $args['category'] = $category;
         } else {
             $args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $category));
         }
     }
     $ex = axiom_get_theme_option('exclude_cats');
     if (!empty($ex)) {
         $args['category__not_in'] = explode(',', $ex);
     }
     $recent_posts = wp_get_recent_posts($args, OBJECT);
     $post_number = 0;
     foreach ($recent_posts as $post) {
         $post_number++;
         require axiom_get_file_dir('templates/parts/widgets-posts.php');
         if ($post_number >= $number) {
             break;
         }
     }
     if (!empty($output)) {
         /* Before widget (defined by themes). */
         echo $before_widget;
         /* Display the widget title if one was input (before and after defined by themes). */
         echo $before_title . $title . $after_title;
         echo $output;
         /* After widget (defined by themes). */
         echo $after_widget;
     }
 }
Пример #2
0
 function axiom_template_list_output($post_options, $post_data)
 {
     $parts = explode('_', $post_options['layout']);
     $layout = max(1, min(4, empty($parts[1]) ? $post_options['columns_count'] : (int) $parts[1]));
     if ($layout == 1) {
         $title = '<li class="post_item sc_blogger_item post_title sc_title sc_blogger_title list_style_' . esc_attr($layout) . '_item">' . '<div class="post_title sc_title sc_blogger_title">' . '<h5>' . (!isset($post_options['links']) || $post_options['links'] ? '<a href="' . esc_url($post_data['post_link']) . '">' : '') . $post_data['post_title'] . (!isset($post_options['links']) || $post_options['links'] ? '</a>' : '') . '</h5>' . '<div class="post_info">' . '<span>by <a href="' . esc_url($post_data['post_author_url']) . '">' . $post_data['post_author'] . '</a></span>' . '<span>Views <span>' . esc_html($post_data['post_views']) . '</span></span>' . '</div>' . '</div>' . '</li>';
         echo $title;
     } else {
         if ($layout == 2) {
             $title = '<li class="post_item sc_blogger_item post_title sc_title sc_blogger_title list_style_' . esc_attr($layout) . '_item">' . '<div class="post_title sc_title sc_blogger_title">' . '<h4>' . (!isset($post_options['links']) || $post_options['links'] ? '<a href="' . esc_url($post_data['post_link']) . '">' : '') . $post_data['post_title'] . (!isset($post_options['links']) || $post_options['links'] ? '</a>' : '') . '</h4>' . '<div class="post_descr">' . balanceTags($post_data['post_excerpt']) . '</div>' . '<div class="post_info">' . '<span>Posted on <span class="date">' . esc_html($post_data['post_date']) . '</span></span>' . '<span><span>' . balanceTags($post_data['post_terms'][$post_data['post_taxonomy']]->terms_links[0]) . '</span></span>' . '</div>' . '</div>' . '</li>';
             echo $title;
         } else {
             if ($layout == 3) {
                 $title = '<li class="post_item sc_blogger_item post_title sc_title sc_blogger_title list_style_' . esc_attr($layout) . '_item">';
                 echo $title;
                 if ($post_data['post_thumb']) {
                     require axiom_get_file_dir('templates/parts/post-featured.php');
                 }
                 $title = '';
                 $title .= '<div class="post_title sc_title sc_blogger_title">' . '<h5>' . (!isset($post_options['links']) || $post_options['links'] ? '<a href="' . esc_url($post_data['post_link']) . '">' : '') . $post_data['post_title'] . (!isset($post_options['links']) || $post_options['links'] ? '</a>' : '') . '</h5>' . '<div class="post_descr">' . substr($post_data['post_excerpt'], 0, 100) . '...</div>' . '</div>' . '</li>';
                 echo $title;
             }
         }
     }
 }
Пример #3
0
 function axiom_sc_add_scripts($output, $tag = '', $atts = array(), $content = '')
 {
     global $AXIOM_GLOBALS;
     if (empty($AXIOM_GLOBALS['shortcodes_scripts_added'])) {
         $AXIOM_GLOBALS['shortcodes_scripts_added'] = true;
         if (axiom_get_theme_option('debug_mode') == 'yes' || axiom_get_theme_option('packed_scripts') == 'no' || !file_exists(axiom_get_file_dir('css/__packed.js'))) {
             axiom_enqueue_script('axiom-shortcodes-script', axiom_get_file_url('shortcodes/shortcodes.js'), array('jquery'), null, true);
         }
     }
     return $output;
 }
Пример #4
0
" value="<?php 
        echo esc_attr($advert_link);
        ?>
" style="width:100%;" />
		</p>

		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('advert_code'));
        ?>
"><?php 
        _e('or paste Advert Widget HTML Code:', 'axiom');
        ?>
</label>
			<textarea id="<?php 
        echo esc_attr($this->get_field_id('advert_code'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('advert_code'));
        ?>
" rows="5" style="width:100%;"><?php 
        echo htmlspecialchars($advert_code);
        ?>
</textarea>
		</p>
	<?php 
    }
}
if (is_admin()) {
    require_once axiom_get_file_dir('core/core.options/core.options-custom.php');
}
Пример #5
0
 function load_scripts()
 {
     if (axiom_get_theme_option('debug_mode') == 'yes' || axiom_get_theme_option('packed_scripts') == 'no' || !file_exists(axiom_get_file_dir('js/__packed.js'))) {
         axiom_enqueue_script('axiom-core-utils-script', axiom_get_file_url('js/core.utils.js'), array('jquery'), null, true);
     }
     axiom_enqueue_script('widget-qrcode-script', axiom_get_file_url('widgets/qrcode/jquery.qrcode-0.6.0.min.js'), array('jquery'), null, true);
 }
Пример #6
0
    function axiom_template_single_team_output($post_options, $post_data)
    {
        $post_data['post_views']++;
        $show_title = axiom_get_custom_option('show_post_title') == 'yes';
        $title_tag = axiom_get_custom_option('show_page_top') == 'yes' && axiom_get_custom_option('show_page_title') == 'yes' ? 'h3' : 'h1';
        axiom_open_wrapper('<article class="' . join(' ', get_post_class('itemscope' . ' post_item post_item_single_team' . ' post_featured_' . esc_attr($post_options['post_class']) . ' post_format_' . esc_attr($post_data['post_format']))) . '"' . ' itemscope itemtype="http://schema.org/Article' . '">');
        $post_icon = axiom_get_custom_option('show_post_icon') == 'yes' ? '<span class="post_icon ' . esc_attr($post_data['post_icon']) . '"></span>' : '';
        if ($show_title && $post_options['location'] == 'center' && (axiom_get_custom_option('show_page_top') == 'no' || axiom_get_custom_option('show_page_title') == 'no')) {
            ?>
			<<?php 
            echo esc_html($title_tag);
            ?>
 itemprop="name" class="post_title entry-title"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</<?php 
            echo esc_html($title_tag);
            ?>
>
			<?php 
        }
        if (!$post_data['post_protected'] && (!empty($post_options['dedicated']) || axiom_get_custom_option('show_featured_image') == 'yes' && $post_data['post_thumb'])) {
            ?>
			<section class="post_featured">
			<?php 
            if (!empty($post_options['dedicated'])) {
                echo $post_options['dedicated'];
            } else {
                axiom_enqueue_popup();
                ?>
				<div class="post_thumb" data-image="<?php 
                echo esc_url($post_data['post_attachment']);
                ?>
" data-title="<?php 
                echo esc_attr($post_data['post_title']);
                ?>
">
					<a class="hover_icon hover_icon_view" href="<?php 
                echo esc_url($post_data['post_attachment']);
                ?>
" title="<?php 
                echo esc_attr($post_data['post_title']);
                ?>
"><?php 
                echo $post_data['post_thumb'];
                ?>
</a>
				</div>
				<?php 
            }
            ?>
			</section>
			<?php 
        }
        if ($show_title && $post_options['location'] != 'center' && (axiom_get_custom_option('show_page_top') == 'no' || axiom_get_custom_option('show_page_title') == 'no')) {
            ?>
			<<?php 
            echo esc_html($title_tag);
            ?>
 itemprop="name" class="post_title entry-title"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</<?php 
            echo esc_html($title_tag);
            ?>
>
			<?php 
        }
        axiom_open_wrapper('<section class="post_content" itemprop="articleBody">');
        // Post content
        if ($post_data['post_protected']) {
            echo $post_data['post_excerpt'];
            echo get_the_password_form();
        } else {
            echo trim(axiom_sc_gap_wrapper(axiom_sc_reviews_wrapper($post_data['post_content'])));
            require axiom_get_file_dir('templates/parts/single-pagination.php');
            if (axiom_get_custom_option('show_post_tags') == 'yes' && !empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links)) {
                ?>
				<div class="post_info post_info_bottom">
					<span class="post_info_item post_info_tags"><?php 
                _e('Tags:', 'axiom');
                ?>
 <?php 
                echo join(', ', $post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links);
                ?>
</span>
				</div>
				<?php 
            }
        }
        axiom_close_wrapper();
        // .post_content
        if (!$post_data['post_protected']) {
            if ($post_data['post_edit_enable']) {
                require axiom_get_file_dir('templates/parts/editor-area.php');
            }
            require axiom_get_file_dir('templates/parts/share.php');
        }
        axiom_close_wrapper();
        // .post_item
        if (!$post_data['post_protected']) {
            require axiom_get_file_dir('templates/parts/related-posts.php');
            require axiom_get_file_dir('templates/parts/comments.php');
        }
        require axiom_get_file_dir('templates/parts/views-counter.php');
    }
Пример #7
0
    function axiom_template_excerpt_output($post_options, $post_data)
    {
        $show_title = true;
        //!in_array($post_data['post_format'], array('aside', 'chat', 'status', 'link', 'quote'));
        $tag = axiom_sc_in_shortcode_blogger(true) ? 'div' : 'article';
        ?>
		<<?php 
        echo $tag;
        ?>
 <?php 
        post_class('post_item post_item_excerpt post_featured_' . esc_attr($post_options['post_class']) . ' post_format_' . esc_attr($post_data['post_format']) . ($post_options['number'] % 2 == 0 ? ' even' : ' odd') . ($post_options['number'] == 0 ? ' first' : '') . ($post_options['number'] == $post_options['posts_on_page'] ? ' last' : '') . ($post_options['add_view_more'] ? ' viewmore' : ''));
        ?>
>

			<?php 
        $post_icon = axiom_get_custom_option('show_post_icon') == 'yes' ? '<span class="post_icon ' . esc_attr($post_data['post_icon']) . '"></span>' : '';
        ?>

			<?php 
        if ($post_data['post_flags']['sticky']) {
            ?>
<span class="sticky_label"></span><?php 
        }
        if ($show_title && $post_options['location'] == 'center' && !empty($post_data['post_title'])) {
            ?>
<h3 class="post_title"><a href="<?php 
            echo esc_url($post_data['post_link']);
            ?>
"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</a></h3><?php 
        }
        if (!$post_data['post_protected'] && (!empty($post_options['dedicated']) || $post_data['post_thumb'] || $post_data['post_gallery'] || $post_data['post_video'] || $post_data['post_audio'])) {
            ?>
				<div class="post_featured">
				<?php 
            if (!empty($post_options['dedicated'])) {
                echo $post_options['dedicated'];
            } else {
                if ($post_data['post_thumb'] || $post_data['post_gallery'] || $post_data['post_video'] || $post_data['post_audio']) {
                    require axiom_get_file_dir('templates/parts/post-featured.php');
                }
            }
            ?>
				</div>
			<?php 
        }
        ?>
	
			<div class="post_content clearfix">
				<?php 
        if ($show_title && $post_options['location'] != 'center' && !empty($post_data['post_title'])) {
            ?>
<h3 class="post_title"><a href="<?php 
            echo esc_url($post_data['post_link']);
            ?>
"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</a></h3><?php 
        }
        if (!$post_data['post_protected'] && $post_options['info']) {
            require axiom_get_file_dir('templates/parts/post-info.php');
        }
        ?>
		
				<div class="post_descr">
				<?php 
        if ($post_data['post_protected']) {
            echo $post_data['post_excerpt'];
        } else {
            if ($post_data['post_excerpt']) {
                echo in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status')) ? $post_data['post_excerpt'] : '<p>' . trim(axiom_strshort($post_data['post_excerpt'], isset($post_options['descr']) ? $post_options['descr'] : axiom_get_custom_option('post_excerpt_maxlength'))) . '</p>';
            }
        }
        if (empty($post_options['readmore'])) {
            $post_options['readmore'] = __('READ MORE', 'axiom');
        }
        if (!axiom_sc_param_is_off($post_options['readmore']) && !in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status'))) {
            echo do_shortcode('[trx_button link="' . esc_url($post_data['post_link']) . '"]' . $post_options['readmore'] . '[/trx_button]');
        }
        ?>
				</div>

			</div>	<!-- /.post_content -->

		</<?php 
        echo $tag;
        ?>
>	<!-- /.post_item -->

	<?php 
    }
Пример #8
0
function axiom_sc_slider($atts, $content = null)
{
    if (axiom_sc_in_shortcode_blogger()) {
        return '';
    }
    extract(axiom_sc_html_decode(shortcode_atts(array("engine" => axiom_get_custom_option('substitute_slider_engine'), "custom" => "no", "alias" => "", "post_type" => "post", "ids" => "", "cat" => "", "count" => "0", "offset" => "", "orderby" => "date", "order" => 'desc', "controls" => "no", "pagination" => "no", "titles" => "no", "descriptions" => axiom_get_custom_option('slider_info_descriptions'), "links" => "no", "align" => "", "interval" => "", "date_format" => "", "crop" => "yes", "autoheight" => "no", "id" => "", "class" => "", "animation" => "", "css" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts)));
    if (empty($width) && $pagination != 'full') {
        $width = "100%";
    }
    if (empty($height) && ($pagination == 'full' || $pagination == 'over')) {
        $height = 250;
    }
    if (!empty($height) && axiom_sc_param_is_on($autoheight)) {
        $autoheight = "off";
    }
    if (empty($interval)) {
        $interval = mt_rand(5000, 10000);
    }
    global $AXIOM_GLOBALS;
    $AXIOM_GLOBALS['sc_slider_engine'] = $engine;
    $AXIOM_GLOBALS['sc_slider_width'] = axiom_prepare_css_value($width);
    $AXIOM_GLOBALS['sc_slider_height'] = axiom_prepare_css_value($height);
    $AXIOM_GLOBALS['sc_slider_links'] = axiom_sc_param_is_on($links);
    $AXIOM_GLOBALS['sc_slider_bg_image'] = false;
    $AXIOM_GLOBALS['sc_slider_crop_image'] = $crop;
    if (empty($id)) {
        $id = "sc_slider_" . str_replace('.', '', mt_rand());
    }
    $ms = axiom_get_css_position_from_values($top, $right, $bottom, $left);
    $ws = axiom_get_css_position_from_values('', '', '', '', $width);
    $hs = axiom_get_css_position_from_values('', '', '', '', '', $height);
    $css .= (!in_array($pagination, array('full', 'over')) ? $ms : '') . $hs . $ws;
    if ($engine != 'swiper' && in_array($pagination, array('full', 'over'))) {
        $pagination = 'yes';
    }
    $output = (in_array($pagination, array('full', 'over')) ? '<div class="sc_slider_pagination_area sc_slider_pagination_' . esc_attr($pagination) . ($align != '' && $align != 'none' ? ' align' . esc_attr($align) : '') . '"' . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . ($ms . $hs ? ' style="' . esc_attr($ms . $hs) . '"' : '') . '>' : '') . '<div' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_slider sc_slider_' . esc_attr($engine) . ($engine == 'swiper' ? ' swiper-slider-container' : '') . (!empty($class) ? ' ' . esc_attr($class) : '') . (axiom_sc_param_is_on($autoheight) ? ' sc_slider_height_auto' : '') . ($hs ? ' sc_slider_height_fixed' : '') . (axiom_sc_param_is_on($controls) ? ' sc_slider_controls' : ' sc_slider_nocontrols') . (axiom_sc_param_is_on($pagination) ? ' sc_slider_pagination' : ' sc_slider_nopagination') . (!in_array($pagination, array('full', 'over')) && $align != '' && $align != 'none' ? ' align' . esc_attr($align) : '') . '"' . (!in_array($pagination, array('full', 'over')) && !axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . (!empty($width) && axiom_strpos($width, '%') === false ? ' data-old-width="' . esc_attr($width) . '"' : '') . (!empty($height) && axiom_strpos($height, '%') === false ? ' data-old-height="' . esc_attr($height) . '"' : '') . ((int) $interval > 0 ? ' data-interval="' . esc_attr($interval) . '"' : '') . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . '>';
    axiom_enqueue_slider($engine);
    if ($engine == 'revo') {
        if (axiom_exists_revslider() && !empty($alias)) {
            $output .= do_shortcode('[rev_slider ' . esc_attr($alias) . ']');
        } else {
            $output = '';
        }
    } else {
        if ($engine == 'swiper') {
            $caption = '';
            $output .= '<div class="slides' . ($engine == 'swiper' ? ' swiper-wrapper' : '') . '"' . ($engine == 'swiper' && $AXIOM_GLOBALS['sc_slider_bg_image'] ? ' style="' . esc_attr($hs) . '"' : '') . '>';
            $content = do_shortcode($content);
            if (axiom_sc_param_is_on($custom) && $content) {
                $output .= $content;
            } else {
                global $post;
                if (!empty($ids)) {
                    $posts = explode(',', $ids);
                    $count = count($posts);
                }
                $args = array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'order' => $order == 'asc' ? 'asc' : 'desc');
                if ($offset > 0 && empty($ids)) {
                    $args['offset'] = $offset;
                }
                $args = axiom_query_add_sort_order($args, $orderby, $order);
                $args = axiom_query_add_filters($args, 'thumbs');
                $args = axiom_query_add_posts_and_cats($args, $ids, $post_type, $cat);
                $query = new WP_Query($args);
                $post_number = 0;
                $pagination_items = '';
                $show_image = 1;
                $show_types = 0;
                $show_date = 1;
                $show_author = 0;
                $show_links = 0;
                $show_counters = 'views';
                //comments | rating
                while ($query->have_posts()) {
                    $query->the_post();
                    $post_number++;
                    $post_id = get_the_ID();
                    $post_type = get_post_type();
                    $post_title = get_the_title();
                    $post_link = get_permalink();
                    $post_link2 = $post_link;
                    $post_date = get_the_date(!empty($date_format) ? $date_format : 'd.m.y');
                    $post_attachment = wp_get_attachment_url(get_post_thumbnail_id($post_id));
                    if (axiom_sc_param_is_on($crop)) {
                        $post_attachment = $AXIOM_GLOBALS['sc_slider_bg_image'] ? axiom_get_resized_image_url($post_attachment, !empty($width) && (double) $width . ' ' == $width . ' ' ? $width : null, !empty($height) && (double) $height . ' ' == $height . ' ' ? $height : null) : axiom_get_resized_image_tag($post_attachment, !empty($width) && (double) $width . ' ' == $width . ' ' ? $width : null, !empty($height) && (double) $height . ' ' == $height . ' ' ? $height : null);
                    } else {
                        if (!$AXIOM_GLOBALS['sc_slider_bg_image']) {
                            $post_attachment = '<img src="' . esc_url($post_attachment) . '" alt="">';
                        }
                    }
                    $post_accent_color = '';
                    $post_category = '';
                    $post_category_link = '';
                    if (in_array($pagination, array('full', 'over'))) {
                        $old_output = $output;
                        $output = '';
                        require axiom_get_file_dir('templates/parts/widgets-posts.php');
                        $pagination_items .= $output;
                        $output = $old_output;
                    }
                    $output .= '<div' . ' class="' . esc_attr($engine) . '-slide"' . ' data-style="' . esc_attr($ws . $hs) . '"' . ' style="' . ($AXIOM_GLOBALS['sc_slider_bg_image'] ? 'background-image:url(' . esc_url($post_attachment) . ');' : '') . $ws . $hs . '"' . '>' . (axiom_sc_param_is_on($links) ? '<a href="' . esc_url($post_link2) . '" title="' . esc_attr($post_title) . '">' : '') . (!$AXIOM_GLOBALS['sc_slider_bg_image'] ? $post_attachment : '');
                    $caption = $engine == 'swiper' ? '' : $caption;
                    if (!axiom_sc_param_is_off($titles)) {
                        $post_hover_bg = axiom_get_custom_option('link_color', null, $post_id);
                        $post_bg = '';
                        if ($post_hover_bg != '' && !axiom_is_inherit_option($post_hover_bg)) {
                            $rgb = axiom_hex2rgb($post_hover_bg);
                            $post_hover_ie = str_replace('#', '', $post_hover_bg);
                            $post_bg = "background-color: rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.8);";
                        }
                        $caption .= '<div class="sc_slider_info' . ($titles == 'fixed' ? ' sc_slider_info_fixed' : '') . ($engine == 'swiper' ? ' content-slide' : '') . '"' . ($post_bg != '' ? ' style="' . esc_attr($post_bg) . '"' : '') . '>';
                        $post_descr = axiom_get_post_excerpt();
                        if (axiom_get_custom_option("slider_info_category") == 'yes') {
                            // || empty($cat)) {
                            // Get all post's categories
                            $post_tax = axiom_get_taxonomy_categories_by_post_type($post_type);
                            if (!empty($post_tax)) {
                                $post_terms = axiom_get_terms_by_post_id(array('post_id' => $post_id, 'taxonomy' => $post_tax));
                                if (!empty($post_terms[$post_tax])) {
                                    if (!empty($post_terms[$post_tax]->closest_parent)) {
                                        $post_category = $post_terms[$post_tax]->closest_parent->name;
                                        $post_category_link = $post_terms[$post_tax]->closest_parent->link;
                                        //$post_accent_color = axiom_taxonomy_get_inherited_property($post_tax, $post_terms[$post_tax]->closest_parent->term_id, 'link_color');
                                    }
                                    /*
                                    if ($post_accent_color == '' && !empty($post_terms[$post_tax]->terms)) {
                                    	for ($i = 0; $i < count($post_terms[$post_tax]->terms); $i++) {
                                    		$post_accent_color = axiom_taxonomy_get_inherited_property($post_tax, $post_terms[$post_tax]->terms[$i]->term_id, 'link_color');
                                    		if ($post_accent_color != '') break;
                                    	}
                                    }
                                    */
                                    if ($post_category != '') {
                                        $caption .= '<div class="sc_slider_category"' . (axiom_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . esc_attr($post_accent_color) . '"' : '') . '><a href="' . esc_url($post_category_link) . '">' . $post_category . '</a></div>';
                                    }
                                }
                            }
                        }
                        $output_reviews = '';
                        if (axiom_get_custom_option('show_reviews') == 'yes' && axiom_get_custom_option('slider_info_reviews') == 'yes') {
                            $avg_author = axiom_reviews_marks_to_display(get_post_meta($post_id, 'reviews_avg' . (axiom_get_theme_option('reviews_first') == 'author' && $orderby != 'users_rating' || $orderby == 'author_rating' ? '' : '2'), true));
                            if ($avg_author > 0) {
                                $output_reviews .= '<div class="sc_slider_reviews post_rating reviews_summary blog_reviews' . (axiom_get_custom_option("slider_info_category") == 'yes' ? ' after_category' : '') . '">' . '<div class="criteria_summary criteria_row">' . trim(axiom_reviews_get_summary_stars($avg_author, false, false, 5)) . '</div>' . '</div>';
                            }
                        }
                        if (axiom_get_custom_option("slider_info_category") == 'yes') {
                            $caption .= $output_reviews;
                        }
                        $caption .= '<h3 class="sc_slider_subtitle"><a href="' . esc_url($post_link2) . '">' . $post_title . '</a></h3>';
                        if (axiom_get_custom_option("slider_info_category") != 'yes') {
                            $caption .= $output_reviews;
                        }
                        if ($descriptions > 0) {
                            $caption .= '<div class="sc_slider_descr">' . trim(axiom_strshort($post_descr, $descriptions)) . '</div>';
                        }
                        $caption .= '</div>';
                    }
                    $output .= ($engine == 'swiper' ? $caption : '') . (axiom_sc_param_is_on($links) ? '</a>' : '') . '</div>';
                }
                wp_reset_postdata();
            }
            $output .= '</div>';
            if ($engine == 'swiper') {
                if (axiom_sc_param_is_on($controls)) {
                    $output .= '<div class="sc_slider_controls_wrap"><a class="sc_slider_prev" href="#"></a><a class="sc_slider_next" href="#"></a></div>';
                }
                if (axiom_sc_param_is_on($pagination)) {
                    $output .= '<div class="sc_slider_pagination_wrap"></div>';
                }
            }
        } else {
            $output = '';
        }
    }
    if (!empty($output)) {
        $output .= '</div>';
        if (!isset($pagination_items)) {
            $pagination_items = '';
        }
        if ($pagination_items) {
            $output .= '
				<div class="sc_slider_pagination widget_area"' . ($hs ? ' style="' . esc_attr($hs) . '"' : '') . '>
					<div id="' . esc_attr($id) . '_scroll" class="sc_scroll sc_scroll_vertical swiper-slider-container scroll-container"' . ($hs ? ' style="' . esc_attr($hs) . '"' : '') . '>
						<div class="sc_scroll_wrapper swiper-wrapper">
							<div class="sc_scroll_slide swiper-slide">
								' . $pagination_items . '
							</div>
						</div>
						<div id="' . esc_attr($id) . '_scroll_bar" class="sc_scroll_bar sc_scroll_bar_vertical"></div>
					</div>
				</div>';
            $output .= '</div>';
        }
    }
    return apply_filters('axiom_shortcode_output', $output, 'trx_slider', $atts, $content);
}
Пример #9
0
 function axiom_admin_register_plugins()
 {
     $plugins = apply_filters('axiom_filter_required_plugins', array(array('name' => 'WooCommerce', 'slug' => 'woocommerce', 'required' => false), array('name' => 'Visual Composer', 'slug' => 'js_composer', 'source' => axiom_get_file_dir('plugins/js_composer.zip'), 'required' => false), array('name' => 'Revolution Slider', 'slug' => 'revslider', 'source' => axiom_get_file_dir('plugins/revslider.zip'), 'required' => false), array('name' => 'Booking Calendar', 'slug' => 'wp-booking-calendar', 'source' => axiom_get_file_dir('plugins/wp-booking-calendar.zip'), 'required' => false), array('name' => 'Essential Grid', 'slug' => 'essential-grid', 'source' => axiom_get_file_dir('plugins/essential-grid.zip'), 'required' => false), array('name' => 'Tribe Events Calendar', 'slug' => 'the-events-calendar', 'source' => axiom_get_file_dir('plugins/the-events-calendar.zip'), 'required' => false), array('name' => 'Instagram Widget', 'slug' => 'wp-instagram-widget', 'source' => axiom_get_file_dir('plugins/wp-instagram-widget.zip'), 'required' => false)));
     $config = array('domain' => 'axiom', 'default_path' => '', 'parent_menu_slug' => 'themes.php', 'parent_url_slug' => 'themes.php', 'menu' => 'install-required-plugins', 'has_notices' => true, 'is_automatic' => true, 'message' => '', 'strings' => array('page_title' => __('Install Required Plugins', 'axiom'), 'menu_title' => __('Install Plugins', 'axiom'), 'installing' => __('Installing Plugin: %s', 'axiom'), 'oops' => __('Something went wrong with the plugin API.', 'axiom'), 'notice_can_install_required' => _n_noop('This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.'), 'notice_can_install_recommended' => _n_noop('This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.'), 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.'), 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.'), 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.'), 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.'), 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.'), 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.'), 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins'), 'activate_link' => _n_noop('Activate installed plugin', 'Activate installed plugins'), 'return' => __('Return to Required Plugins Installer', 'axiom'), 'plugin_activated' => __('Plugin activated successfully.', 'axiom'), 'complete' => __('All plugins installed and activated successfully. %s', 'axiom'), 'nag_type' => 'updated'));
     tgmpa($plugins, $config);
 }
Пример #10
0
    function axiom_template_attachment_output($post_options, $post_data)
    {
        $post_data['post_views']++;
        $title_tag = axiom_get_custom_option('show_page_top') == 'yes' && axiom_get_custom_option('show_page_title') == 'yes' ? 'h3' : 'h1';
        ?>
		<article <?php 
        post_class('post_item post_item_attachment template_attachment');
        ?>
>

		<?php 
        $post_icon = axiom_get_custom_option('show_post_icon') == 'yes' ? '<span class="post_icon ' . esc_attr($post_data['post_icon']) . '"></span>' : '';
        ?>

			<<?php 
        echo esc_html($title_tag);
        ?>
 class="post_title"><?php 
        echo balanceTags($post_icon);
        echo !empty($post_data['post_excerpt']) ? strip_tags($post_data['post_excerpt']) : $post_data['post_title'];
        ?>
</<?php 
        echo esc_html($title_tag);
        ?>
>

			<div class="post_featured">
				<div class="post_thumb post_nav" data-image="<?php 
        echo esc_url($post_data['post_attachment']);
        ?>
" data-title="<?php 
        echo esc_attr($post_data['post_title']);
        ?>
">
					<?php 
        echo $post_data['post_thumb'];
        $post = get_post();
        $attachments = array_values(get_children(array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID')));
        foreach ($attachments as $k => $attachment) {
            if ($attachment->ID == $post->ID) {
                break;
            }
        }
        if (isset($attachments[$k - 1])) {
            $link = get_permalink($attachments[$k - 1]->ID) . '#top_of_page';
            $desc = axiom_strshort(!empty($attachments[$k - 1]->post_excerpt) ? $attachments[$k - 1]->post_excerpt : $attachments[$k - 1]->post_title, 30);
            ?>
						<a class="post_nav_item post_nav_prev" href="<?php 
            echo esc_url($link);
            ?>
">
							<span class="post_nav_info">
								<span class="post_nav_info_title"><?php 
            _e('Previous item', 'axiom');
            ?>
</span>
								<span class="post_nav_info_description"><?php 
            echo $desc;
            ?>
</span>
							</span>
						</a>
						<?php 
        }
        if (isset($attachments[$k + 1])) {
            $link = get_permalink($attachments[$k + 1]->ID) . '#top_of_page';
            $desc = axiom_strshort(!empty($attachments[$k + 1]->post_excerpt) ? $attachments[$k + 1]->post_excerpt : $attachments[$k + 1]->post_title, 30);
            ?>
						<a class="post_nav_item post_nav_next" href="<?php 
            echo esc_url($link);
            ?>
">
							<span class="post_nav_info">
								<span class="post_nav_info_title"><?php 
            _e('Next item', 'axiom');
            ?>
</span>
								<span class="post_nav_info_description"><?php 
            echo $desc;
            ?>
</span>
							</span>
						</a>
						<?php 
        }
        ?>
				</div>
			</div>
		
			<?php 
        if (!$post_data['post_protected'] && axiom_get_custom_option('show_post_info') == 'yes') {
            require axiom_get_file_dir('templates/parts/post-info.php');
        }
        ?>
		
			<div class="post_content">
				<?php 
        // Post content
        if ($post_data['post_protected']) {
            echo $post_data['post_excerpt'];
        } else {
            echo $post_data['post_content'] ? $post_data['post_content'] : __('No image description ...', 'axiom');
            wp_link_pages(array('before' => '<div class="nav_pages_parts"><span class="pages">' . __('Pages:', 'axiom') . '</span>', 'after' => '</div>', 'link_before' => '<span class="page_num">', 'link_after' => '</span>'));
            if (axiom_get_custom_option('show_post_tags') == 'yes' && !empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links)) {
                ?>
						<div class="post_info post_info_bottom">
							<span class="post_info_item post_info_tags"><?php 
                _e('Tags:', 'axiom');
                ?>
 <?php 
                echo join(', ', $post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links);
                ?>
</span>
						</div>
						<?php 
            }
        }
        ?>
			
			</div>	<!-- /.post_content -->
		
		</article>

		<section class="related_wrap related_wrap_empty"></section>

		<?php 
        if (!$post_data['post_protected']) {
            require axiom_get_file_dir('templates/parts/comments.php');
        }
        require axiom_get_file_dir('templates/parts/views-counter.php');
    }
Пример #11
0
 function axiom_get_list_icons($prepend_inherit = false)
 {
     global $AXIOM_GLOBALS;
     if (isset($AXIOM_GLOBALS['list_icons'])) {
         $list = $AXIOM_GLOBALS['list_icons'];
     } else {
         $AXIOM_GLOBALS['list_icons'] = $list = axiom_parse_icons_classes(axiom_get_file_dir("css/fontello/css/fontello-codes.css"));
     }
     return $prepend_inherit ? axiom_array_merge(array('inherit' => __("Inherit", 'axiom')), $list) : $list;
 }
Пример #12
0
    function axiom_template_date_output($post_options, $post_data)
    {
        if (axiom_sc_param_is_on($post_options['scroll'])) {
            axiom_enqueue_slider();
        }
        require axiom_get_file_dir('templates/parts/reviews-summary.php');
        ?>
		
		<div class="post_item sc_blogger_item
			<?php 
        echo $post_options['number'] == $post_options['posts_on_page'] && !axiom_sc_param_is_on($post_options['loadmore']) ? ' sc_blogger_item_last' : '';
        //. (axiom_sc_param_is_on($post_options['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
        ?>
"
			<?php 
        echo $post_options['dir'] == 'horizontal' ? ' style="width:' . 100 / $post_options['posts_on_page'] . '%"' : '';
        ?>
>
			<div class="sc_blogger_date">
				<span class="day_month"><?php 
        echo $post_data['post_date_part1'];
        ?>
</span>
				<span class="year"><?php 
        echo $post_data['post_date_part2'];
        ?>
</span>
			</div>

			<div class="post_content">
				<h5 class="post_title sc_title sc_blogger_title">
					<?php 
        echo !isset($post_options['links']) || $post_options['links'] ? '<a href="' . esc_url($post_data['post_link']) . '">' : '';
        ?>
					<?php 
        echo $post_data['post_title'];
        ?>
					<?php 
        echo !isset($post_options['links']) || $post_options['links'] ? '</a>' : '';
        ?>
				</h5>
				
				<?php 
        echo $reviews_summary;
        ?>
	
				<?php 
        if (axiom_sc_param_is_on($post_options['info'])) {
            ?>
				<div class="post_info">
					<span class="post_info_item post_info_posted_by"><?php 
            _e('by', 'axiom');
            ?>
 <a href="<?php 
            echo esc_url($post_data['post_author_url']);
            ?>
" class="post_info_author"><?php 
            echo esc_html($post_data['post_author']);
            ?>
</a></span>
					<span class="post_info_item post_info_counters">
						<?php 
            echo $post_options['orderby'] == 'comments' || $post_options['counters'] == 'comments' ? __('Comments', 'axiom') : __('Views', 'axiom');
            ?>
						<span class="post_info_counters_number"><?php 
            echo $post_options['orderby'] == 'comments' || $post_options['counters'] == 'comments' ? $post_data['post_comments'] : $post_data['post_views'];
            ?>
</span>
					</span>
				</div>
				<?php 
        }
        ?>

			</div>	<!-- /.post_content -->
		
		</div>		<!-- /.post_item -->

		<?php 
        if ($post_options['number'] == $post_options['posts_on_page'] && axiom_sc_param_is_on($post_options['loadmore'])) {
            ?>
			<div class="load_more<?php 
            //echo esc_attr(axiom_sc_param_is_on($post_options['scroll']) && $post_options['dir'] == 'vertical' ? ' sc_scroll_slide swiper-slide' : '');
            ?>
"<?php 
            echo $post_options['dir'] == 'horizontal' ? ' style="width:' . 100 / $post_options['posts_on_page'] . '%"' : '';
            ?>
></div>
		<?php 
        }
    }
Пример #13
0
 function axiom_callback_ajax_search()
 {
     global $_REQUEST, $post, $wp_query;
     if (!wp_verify_nonce($_REQUEST['nonce'], 'ajax_nonce')) {
         die;
     }
     $response = array('error' => '', 'data' => '');
     $s = $_REQUEST['text'];
     if (!empty($s)) {
         $show_types = axiom_get_theme_option('ajax_search_types');
         $show_date = axiom_get_theme_option('ajax_search_posts_date') == 'yes' ? 1 : 0;
         $show_image = axiom_get_theme_option('ajax_search_posts_image') == 'yes' ? 1 : 0;
         $show_author = axiom_get_theme_option('ajax_search_posts_author') == 'yes' ? 1 : 0;
         $show_counters = axiom_get_theme_option('ajax_search_posts_counters') == 'yes' ? axiom_get_theme_option('blog_counters') : '';
         $args = array('post_status' => 'publish', 'orderby' => 'date', 'order' => 'desc', 'posts_per_page' => max(1, min(10, axiom_get_theme_option('ajax_search_posts_count'))), 's' => esc_html($s));
         // Filter post types
         if (!empty($show_types)) {
             $args['post_type'] = explode(',', $show_types);
         }
         // Exclude categories
         if (axiom_strpos($show_types, 'post') !== false) {
             $ex = axiom_get_theme_option('exclude_cats');
             if (!empty($ex)) {
                 $args['category__not_in'] = explode(',', $ex);
             }
         }
         $args = apply_filters('ajax_search_query', $args);
         $post_number = 0;
         $output = '';
         if (!isset($wp_query)) {
             $wp_query = new WP_Query($args);
         } else {
             query_posts($args);
         }
         while (have_posts()) {
             the_post();
             $post_number++;
             require axiom_get_file_dir('templates/parts/widgets-posts.php');
         }
         if (empty($output)) {
             $output .= '<article class="post_item">' . __('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'axiom') . '</article>';
         } else {
             $output .= '<article class="post_item"><a href="#" class="post_more">' . __('More results &hellip;', 'axiom') . '</a></article>';
         }
         $response['data'] = $output;
     } else {
         $response['error'] = __('The query string is empty!', 'axiom');
     }
     echo json_encode($response);
     die;
 }
Пример #14
0
<?php 
if (axiom_get_custom_option('show_left_panel') == 'yes') {
    axiom_enqueue_slider();
    require_once axiom_get_file_dir('templates/parts/left-panel.php');
}
?>

<?php 
if (axiom_get_theme_option('show_login') == 'yes' || axiom_get_custom_option('show_left_panel') == 'yes') {
    require_once axiom_get_file_dir('templates/parts/register.php');
}
?>

<?php 
if (axiom_get_theme_option('show_login') == 'yes' || axiom_get_custom_option('show_left_panel') == 'yes') {
    require_once axiom_get_file_dir('templates/parts/login.php');
}
?>

<?php 
if (axiom_get_custom_option('show_scroll_to_top') == 'yes') {
    ?>
<a href="#" class="scroll_to_top icon-angle-up-1" title="<?php 
    _e('Scroll to top', 'axiom');
    ?>
"></a>
<?php 
}
?>

<?php 
Пример #15
0
    function axiom_template_single_portfolio_output($post_options, $post_data)
    {
        $post_data['post_views']++;
        $avg_author = 0;
        $avg_users = 0;
        if (!$post_data['post_protected'] && $post_options['reviews'] && axiom_get_custom_option('show_reviews') == 'yes') {
            $avg_author = $post_data['post_reviews_author'];
            $avg_users = $post_data['post_reviews_users'];
        }
        $show_title = axiom_get_custom_option('show_post_title') == 'yes' && (axiom_get_custom_option('show_post_title_on_quotes') == 'yes' || !in_array($post_data['post_format'], array('aside', 'chat', 'status', 'link', 'quote')));
        axiom_open_wrapper('<article class="' . join(' ', get_post_class('itemscope' . ' post_item' . ' post_featured_' . esc_attr($post_options['post_class']) . ' post_format_' . esc_attr($post_data['post_format']))) . '"' . ' itemscope itemtype="http://schema.org/' . ($avg_author > 0 || $avg_users > 0 ? 'Review' : 'Article') . '">');
        require axiom_get_file_dir('templates/parts/prev-next-posts.php');
        if ($show_title) {
            ?>
			<h1 itemprop="<?php 
            echo $avg_author > 0 || $avg_users > 0 ? 'itemReviewed' : 'name';
            ?>
" class="post_title entry-title"><?php 
            echo $post_data['post_title'];
            ?>
</h1>
			<?php 
        }
        if (!$post_data['post_protected'] && axiom_get_custom_option('show_post_info') == 'yes') {
            require axiom_get_file_dir('templates/parts/post-info.php');
        }
        require axiom_get_file_dir('templates/parts/reviews-block.php');
        axiom_open_wrapper('<section class="post_content" itemprop="' . ($avg_author > 0 || $avg_users > 0 ? 'reviewBody' : 'articleBody') . '">');
        // Post content
        if ($post_data['post_protected']) {
            echo $post_data['post_excerpt'];
            echo get_the_password_form();
        } else {
            if (axiom_strpos($post_data['post_content'], axiom_sc_reviews_placeholder()) === false) {
                $post_data['post_content'] = do_shortcode('[trx_reviews]') . $post_data['post_content'];
            }
            echo trim(axiom_sc_gap_wrapper(axiom_sc_reviews_wrapper($post_data['post_content'])));
            require axiom_get_file_dir('templates/parts/single-pagination.php');
            if (axiom_get_custom_option('show_post_tags') == 'yes' && !empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links)) {
                ?>
				<div class="post_info">
					<span class="post_info_item post_info_tags"><?php 
                _e('in', 'axiom');
                ?>
 <?php 
                echo join(', ', $post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links);
                ?>
</span>
				</div>
				<?php 
            }
        }
        axiom_close_wrapper();
        // .post_content
        if (!$post_data['post_protected']) {
            if ($post_data['post_edit_enable']) {
                require axiom_get_file_dir('templates/parts/editor-area.php');
            }
            require axiom_get_file_dir('templates/parts/author-info.php');
            require axiom_get_file_dir('templates/parts/share.php');
            require axiom_get_file_dir('templates/parts/related-posts.php');
            require axiom_get_file_dir('templates/parts/comments.php');
        }
        axiom_close_wrapper();
        // .post_item
        require axiom_get_file_dir('templates/parts/views-counter.php');
    }
Пример #16
0
 function import_booking()
 {
     if (!axiom_exists_booking()) {
         return;
     }
     if (empty($this->options['file_with_booking'])) {
         return;
     }
     echo '<br><b>' . __('Import Booking Calendar ...', 'axiom') . '</b><br>';
     flush();
     $booking_txt = axiom_fgc(axiom_get_file_dir($this->options['file_with_booking']));
     $data = unserialize(base64_decode($booking_txt));
     if (is_array($data) && count($data) > 0) {
         global $wpdb;
         foreach ($data as $table => $rows) {
             $values = '';
             $fields = '';
             foreach ($rows as $row) {
                 $f = '';
                 $v = '';
                 foreach ($row as $field => $value) {
                     $f .= ($f ? ',' : '') . "'" . esc_sql($field) . "'";
                     $v .= ($v ? ',' : '') . "'" . esc_sql($value) . "'";
                 }
                 if ($fields == '') {
                     $fields = '(' . $f . ')';
                 }
                 $values .= ($values ? ',' : '') . '(' . $v . ')';
             }
             // Attention! All items in the variable $values escaped on the loop above - esc_sql($value)
             $res = $wpdb->query("TRUNCATE TABLE " . esc_sql($wpdb->prefix . $table));
             $q = "INSERT INTO " . esc_sql($wpdb->prefix . $table) . " VALUES {$values}";
             $wpdb->query($q);
         }
     }
 }
Пример #17
0
 function axiom_enqueue_diagram($type = 'all')
 {
     if (axiom_get_theme_option('debug_mode') == 'yes' || axiom_get_theme_option('packed_scripts') == 'no' || !file_exists(axiom_get_file_dir('js/__packed.js'))) {
         if ($type == 'all' || $type == 'pie') {
             axiom_enqueue_script('axiom-diagram-chart-script', axiom_get_file_url('js/diagram/chart.min.js'), array(), null, true);
         }
         if ($type == 'all' || $type == 'arc') {
             axiom_enqueue_script('axiom-diagram-raphael-script', axiom_get_file_url('js/diagram/diagram.raphael.min.js'), array(), 'no-compose', true);
         }
     }
 }
Пример #18
0
><?php 
    echo esc_html($post_data['post_date']);
    ?>
</a> <span>/</span> <?php 
    the_category(', ');
    ?>
</span>
					<?php 
}
if ($info_parts['terms'] && !empty($post_data['post_terms'][$post_data['post_taxonomy']]->terms_links)) {
    ?>
					<span class="post_info_item post_info_tags"><?php 
    _e('in', 'axiom');
    ?>
 <?php 
    echo join(', ', $post_data['post_terms'][$post_data['post_taxonomy']]->terms_links);
    ?>
</span>
					<?php 
}
if ($info_parts['counters']) {
    ?>
					<span class="post_info_item post_info_counters"><?php 
    require axiom_get_file_dir('templates/parts/counters.php');
    ?>
</span>
					<?php 
}
?>
			</div>
Пример #19
0
    function axiom_template_related_output($post_options, $post_data)
    {
        $show_title = true;
        //!in_array($post_data['post_format'], array('aside', 'chat', 'status', 'link', 'quote'));
        $parts = explode('_', $post_options['layout']);
        $style = $parts[0];
        $columns = max(1, min(4, empty($parts[1]) ? $post_options['columns_count'] : (int) $parts[1]));
        $tag = axiom_sc_in_shortcode_blogger(true) ? 'div' : 'article';
        //require(axiom_get_file_dir('templates/parts/reviews-summary.php'));
        if ($columns > 1) {
            ?>
			<div class="<?php 
            echo 'column-1_' . esc_attr($columns);
            ?>
 column_padding_bottom">
			<?php 
        }
        ?>
		<<?php 
        echo $tag;
        ?>
 class="post_item post_item_<?php 
        echo esc_attr($style);
        ?>
 post_item_<?php 
        echo esc_attr($post_options['number']);
        ?>
">

			<div class="post_content">
				<?php 
        if ($post_data['post_video'] || $post_data['post_thumb'] || $post_data['post_gallery']) {
            ?>
				<div class="post_featured">
					<?php 
            require axiom_get_file_dir('templates/parts/post-featured.php');
            ?>
				</div>
				<?php 
        }
        ?>

				<?php 
        if ($show_title) {
            ?>
					<div class="post_content_wrap">
					<?php 
            if (!isset($post_options['links']) || $post_options['links']) {
                ?>
						<h4 class="post_title"><a href="<?php 
                echo esc_url($post_data['post_link']);
                ?>
"><?php 
                echo $post_data['post_title'];
                ?>
</a></h4>
					<?php 
            } else {
                ?>
						<h4 class="post_title"><?php 
                echo $post_data['post_title'];
                ?>
</h4>
					<?php 
            }
            //echo ($reviews_summary);
            ?>
					</div>
				<?php 
        }
        ?>
			</div>	<!-- /.post_content -->
		</<?php 
        echo $tag;
        ?>
>	<!-- /.post_item -->
		<?php 
        if ($columns > 1) {
            ?>
			</div>
			<?php 
        }
    }
Пример #20
0
    /**
     * How to display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args);
        global $wp_query, $post;
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
        $number = isset($instance['number']) ? (int) $instance['number'] : '';
        $show_date = isset($instance['show_date']) ? (int) $instance['show_date'] : 0;
        $show_image = isset($instance['show_image']) ? (int) $instance['show_image'] : 0;
        $show_author = isset($instance['show_author']) ? (int) $instance['show_author'] : 0;
        $show_counters = isset($instance['show_counters']) ? (int) $instance['show_counters'] : 0;
        $show_counters = $show_counters == 2 ? 'stars' : ($show_counters == 1 ? 'rating' : '');
        $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post';
        $category = isset($instance['category']) ? (int) $instance['category'] : 0;
        $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type);
        $output = '';
        $post_rating = 'reviews_avg' . (axiom_get_theme_option('reviews_first') == 'author' ? '' : '2');
        $args = array('post_type' => $post_type, 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'post_password' => '', 'posts_per_page' => $number, 'ignore_sticky_posts' => 1, 'order' => 'DESC', 'orderby' => 'date', 'meta_query' => array(array('key' => $post_rating, 'value' => 0, 'compare' => '>', 'type' => 'NUMERIC')));
        if ($category > 0) {
            if ($taxonomy == 'category') {
                $args['cat'] = $category;
            } else {
                $args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $category));
            }
        }
        $ex = axiom_get_theme_option('exclude_cats');
        if (!empty($ex)) {
            $args['category__not_in'] = explode(',', $ex);
        }
        query_posts($args);
        /* Loop posts */
        if (have_posts()) {
            $post_number = 0;
            while (have_posts()) {
                the_post();
                $post_number++;
                require axiom_get_file_dir('templates/parts/widgets-posts.php');
                if ($post_number >= $number) {
                    break;
                }
            }
        }
        /* Restore main wp_query and current post data in the global var $post */
        wp_reset_query();
        wp_reset_postdata();
        if (!empty($output)) {
            /* Before widget (defined by themes). */
            echo $before_widget;
            /* Display the widget title if one was input (before and after defined by themes). */
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            echo '
				<div class="recent_reviews">
					' . $output . '
				</div>
			';
            /* After widget (defined by themes). */
            echo $after_widget;
        }
    }
Пример #21
0
    function axiom_template_event_output($post_options, $post_data)
    {
        $show_title = true;
        $columns = (int) $post_options['columns_count'];
        $style = $post_options['template_style'];
        $cust = get_post_custom($post_data['post_id']);
        $event_date_temp = strtotime($cust['_EventStartDate'][0]);
        $event_date = $style == 'classic' ? date('F d', $event_date_temp) : date('d M Y', $event_date_temp);
        ?>
		<div class="isotope_item isotope_item_<?php 
        echo esc_attr($style);
        ?>
 isotope_item_<?php 
        echo esc_attr($post_options['layout']);
        ?>
 isotope_column_<?php 
        echo esc_attr($columns);
        ?>
		<?php 
        if ($post_options['filters'] != '') {
            if ($post_options['filters'] == 'categories' && !empty($post_data['post_terms'][$post_data['post_taxonomy']]->terms_ids)) {
                echo ' flt_' . join(' flt_', $post_data['post_terms'][$post_data['post_taxonomy']]->terms_ids);
            } else {
                if ($post_options['filters'] == 'tags' && !empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_ids)) {
                    echo ' flt_' . join(' flt_', $post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_ids);
                }
            }
        }
        ?>
">
			<div class="post_item post_item_<?php 
        echo esc_attr($style);
        ?>
 post_item_<?php 
        echo esc_attr($post_options['layout']);
        ?>
		<?php 
        echo ' post_format_' . esc_attr($post_data['post_format']) . ($post_options['number'] % 2 == 0 ? ' even' : ' odd') . ($post_options['number'] == 0 ? ' first' : '') . ($post_options['number'] == $post_options['posts_on_page'] ? ' last' : '');
        ?>
">
				<?php 
        if (($post_data['post_video'] || $post_data['post_audio'] || $post_data['post_thumb'] || $post_data['post_gallery']) && ($style == 'classic' || $style == 'classic2')) {
            ?>
					<div class="post_featured">
						<?php 
            require axiom_get_file_dir('templates/parts/post-featured.php');
            ?>
					</div>
				<?php 
        }
        ?>

				<div class="post_content isotope_item_content">
					<?php 
        if ($style == 'list') {
            ?>
						<div class="startDate">
							<div><?php 
            echo esc_html($event_date);
            ?>
</div>
						</div>
						<?php 
            if ($show_title) {
                ?>
							<h5><a href="<?php 
                echo esc_url($post_data['post_link']);
                ?>
"><?php 
                echo esc_html($post_data['post_title']);
                ?>
</a></h5>
						<?php 
            }
            ?>
					<?php 
        }
        ?>

					<?php 
        if ($style == 'classic' || $style == 'classic2') {
            ?>
						<?php 
            if ($show_title) {
                ?>
							<h5>
								<?php 
                if ($style == 'classic2') {
                    echo "<a href='" . esc_url($post_data['post_link']) . "'>";
                }
                ?>
								<?php 
                echo esc_html($post_data['post_title']);
                ?>
								<?php 
                if ($style == 'classic2') {
                    echo "</a>";
                }
                ?>
							</h5>
						<?php 
            }
            ?>
					<div class="startDate">
						<?php 
            echo esc_html($event_date);
            ?>
					</div>
					<?php 
        }
        ?>
					<?php 
        if ($style == 'classic') {
            ?>
					<a href="<?php 
            echo esc_url($post_data['post_link']);
            ?>
" class="sc_button sc_button_style_accent_1 sc_button_size_big squareButton accent_1 big"><?php 
            echo __('learn more', 'axiom');
            ?>
</a>
					<?php 
        }
        ?>
				</div>
			</div>

		</div>

<?php 
    }
Пример #22
0
 function axiom_action_add_scripts_education()
 {
     if (file_exists(axiom_get_file_dir('skins/default/skin.js'))) {
         axiom_enqueue_script('theme-skin-script', axiom_get_file_url('skins/default/skin.js'), array(), null);
     }
     if (axiom_get_theme_option('show_theme_customizer') == 'yes' && file_exists(axiom_get_file_dir('skins/default/skin.customizer.js'))) {
         axiom_enqueue_script('theme-skin-customizer-script', axiom_get_file_url('skins/default/skin.customizer.js'), array(), null);
     }
 }
Пример #23
0
 /**
  * How to display the widget on the screen.
  */
 function widget($args, $instance)
 {
     extract($args);
     global $wp_query, $post;
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
     $title_tabs = array(apply_filters('widget_title', isset($instance['title_author']) ? $instance['title_author'] : ''), apply_filters('widget_title', isset($instance['title_users']) ? $instance['title_users'] : ''));
     $number = isset($instance['number']) ? (int) $instance['number'] : '';
     $show_date = isset($instance['show_date']) ? (int) $instance['show_date'] : 0;
     $show_image = isset($instance['show_image']) ? (int) $instance['show_image'] : 0;
     $show_author = isset($instance['show_author']) ? (int) $instance['show_author'] : 0;
     $show_counters = isset($instance['show_counters']) ? (int) $instance['show_counters'] : 0;
     $show_counters = $show_counters == 2 ? 'stars' : ($show_counters == 1 ? 'rating' : '');
     $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post';
     $category = isset($instance['category']) ? (int) $instance['category'] : 0;
     $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type);
     $tabs = array();
     $reviews_first_author = axiom_get_theme_option('reviews_first') == 'author';
     $reviews_second_hide = axiom_get_theme_option('reviews_second') == 'hide';
     $rnd = str_replace('.', '', mt_rand());
     for ($i = 0; $i < 2; $i++) {
         if ($i == 0 && !$reviews_first_author && $reviews_second_hide) {
             continue;
         }
         if ($i == 1 && $reviews_first_author && $reviews_second_hide) {
             continue;
         }
         $post_rating = 'reviews_avg' . ($i == 0 ? '' : '2');
         $args = array('post_type' => $post_type, 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'post_password' => '', 'posts_per_page' => $number, 'ignore_sticky_posts' => 1, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => $post_rating);
         if ($category > 0) {
             if ($taxonomy == 'category') {
                 $args['cat'] = $category;
             } else {
                 $args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $category));
             }
         }
         $ex = axiom_get_theme_option('exclude_cats');
         if (!empty($ex)) {
             $args['category__not_in'] = explode(',', $ex);
         }
         query_posts($args);
         /* Loop posts */
         if (have_posts()) {
             $post_number = 0;
             $output = '';
             while (have_posts()) {
                 the_post();
                 $post_number++;
                 require axiom_get_file_dir('templates/parts/widgets-posts.php');
                 if ($post_number >= $number) {
                     break;
                 }
             }
             $tabs[] = array('title' => $title_tabs[$i], 'content' => $output);
         }
     }
     /* Restore main wp_query and current post data in the global var $post */
     wp_reset_query();
     wp_reset_postdata();
     if (count($tabs) > 0) {
         if (count($tabs) > 1) {
             axiom_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true);
         }
         /* Before widget (defined by themes). */
         echo $before_widget;
         /* Display the widget title if one was input (before and after defined by themes). */
         if ($title) {
             echo $before_title . $title . $after_title;
         }
         echo count($tabs) == 1 ? $tabs[0]['content'] : do_shortcode('[trx_tabs style="2"][trx_tab title="' . esc_attr($tabs[0]['title']) . '"]' . $tabs[0]['content'] . '[/trx_tab][trx_tab title="' . esc_attr($tabs[1]['title']) . '"]' . $tabs[1]['content'] . '[/trx_tab][/trx_tabs]');
         /* After widget (defined by themes). */
         echo $after_widget;
     }
 }
Пример #24
0
    function axiom_template_news_output($post_options, $post_data)
    {
        if (axiom_sc_param_is_on($post_options['scroll'])) {
            axiom_enqueue_slider();
        }
        require axiom_get_file_dir('templates/parts/reviews-summary.php');
        $title_tag = $post_options['columns_count'] > 0 ? 'h6' : 'h4';
        $title = '<' . esc_attr($title_tag) . ' class="post_title sc_title sc_blogger_title">' . (!isset($post_options['links']) || $post_options['links'] ? '<a href="' . esc_url($post_data['post_link']) . '">' : '') . $post_data['post_title'] . (!isset($post_options['links']) || $post_options['links'] ? '</a>' : '') . '</' . esc_attr($title_tag) . '>' . $reviews_summary;
        if (axiom_sc_param_is_on($post_options['scroll']) || $post_options['dir'] == 'horizontal' && $post_options['columns_count'] > 0) {
            ?>
			<div class="<?php 
            echo 'column-1_' . esc_attr($post_options['columns_count']) . ' column_item_' . esc_attr($post_options['number']);
            echo ($post_options['number'] % 2 == 1 ? ' odd' : ' even') . ($post_options['number'] == 1 ? ' first' : '') . ($post_options['number'] == $post_options['posts_on_page'] ? ' last' : '');
            //. (axiom_sc_param_is_on($post_options['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
            ?>
">
			<?php 
        }
        ?>
		
		<div class="post_item post_item_news sc_blogger_item<?php 
        echo $post_options['number'] == $post_options['posts_on_page'] && !axiom_sc_param_is_on($post_options['loadmore']) ? ' sc_blogger_item_last' : '';
        //. (axiom_sc_param_is_on($post_options['scroll']) && $post_options['dir'] == 'vertical' ? ' sc_scroll_slide swiper-slide' : '');
        ?>
">
			<?php 
        if ($post_data['post_video'] || $post_data['post_audio'] || $post_data['post_thumb'] || $post_data['post_gallery']) {
            ?>
				<div class="post_featured">
					<?php 
            require axiom_get_file_dir('templates/parts/post-featured.php');
            ?>
				</div>
				<?php 
        }
        echo $title;
        ?>
			
			<div class="post_content sc_blogger_content">
				<?php 
        if (axiom_sc_param_is_on($post_options['info'])) {
            $info_parts = array('author' => false);
            require axiom_get_file_dir('templates/parts/post-info.php');
        }
        if ($post_options['descr'] > 0) {
            ?>
					<div class="post_descr">
					<?php 
            if ($post_data['post_protected']) {
                echo $post_data['post_excerpt'];
            } else {
                if ($post_data['post_excerpt']) {
                    echo in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status')) ? $post_data['post_excerpt'] : '<p>' . trim(axiom_strshort($post_data['post_excerpt'], isset($post_options['descr']) ? $post_options['descr'] : axiom_get_custom_option('post_excerpt_maxlength_masonry'))) . '</p>';
                }
                if (empty($post_options['readmore'])) {
                    $post_options['readmore'] = __('READ MORE', 'axiom');
                }
                if (!axiom_sc_param_is_off($post_options['readmore']) && !in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status'))) {
                    echo do_shortcode('[trx_button link="' . esc_url($post_data['post_link']) . '"]' . $post_options['readmore'] . '[/trx_button]');
                }
            }
            ?>
					</div>
					<?php 
        }
        if (empty($post_options['readmore'])) {
            $post_options['readmore'] = __('READ MORE', 'axiom');
        }
        if (!axiom_sc_param_is_off($post_options['readmore']) && !in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status'))) {
            echo do_shortcode('[trx_button link="' . esc_url($post_data['post_link']) . '"]' . $post_options['readmore'] . '[/trx_button]');
        }
        ?>

			</div>	<!-- /.post_content -->

		</div>		<!-- /.post_item -->
		<?php 
        if (axiom_sc_param_is_on($post_options['scroll']) || $post_options['dir'] == 'horizontal' && $post_options['columns_count'] > 0) {
            ?>
			</div>	<!-- /.column-1_x -->
			<?php 
        }
    }
Пример #25
0
						<?php 
    if ($show_title) {
        ?>
							<h1 class="page_title"><?php 
        echo strip_tags(axiom_get_blog_title());
        ?>
</h1>
						<?php 
    }
    ?>
					</div>
				</div>
			<?php 
}
if (is_page('resource-centre-1')) {
    require_once axiom_get_file_dir('templates/parts/resource-centre-top.php');
}
?>

			<div class="page_content_wrap<?php 
echo axiom_get_custom_option('custom_page_paddings') == 'no' ? '' : ' wrap_custom';
?>
"<?php 
echo axiom_get_custom_option('show_page_top') == 'no' ? ' ' . trim($header_style) : '';
?>
>

				<?php 
// Content and sidebar wrapper
if (!is_singular(array('resource'))) {
    if ($body_style != 'fullscreen') {
Пример #26
0
 function axiom_options_save()
 {
     global $AXIOM_GLOBALS;
     if (!wp_verify_nonce($_POST['nonce'], 'ajax_nonce')) {
         die;
     }
     $mode = $_POST['mode'];
     $override = $_POST['override'] == '' ? 'general' : $_POST['override'];
     $options = $AXIOM_GLOBALS['options'];
     if ($mode == 'save') {
         parse_str($_POST['data'], $post_data);
     } else {
         if ($mode == 'export') {
             parse_str($_POST['data'], $post_data);
             if (!empty($AXIOM_GLOBALS['post_meta_box']['fields'])) {
                 $options = axiom_array_merge($AXIOM_GLOBALS['options'], $AXIOM_GLOBALS['post_meta_box']['fields']);
             }
         } else {
             $post_data = array();
         }
     }
     $custom_options = array();
     axiom_options_merge_new_values($options, $custom_options, $post_data, $mode, $override);
     if ($mode == 'export') {
         $name = trim(chop($_POST['name']));
         $name2 = isset($_POST['name2']) ? trim(chop($_POST['name2'])) : '';
         $key = $name == '' ? $name2 : $name;
         $export = get_option('axiom_options_' . $override, array());
         $export[$key] = $custom_options;
         if ($name != '' && $name2 != '') {
             unset($export[$name2]);
         }
         update_option('axiom_options_' . $override, $export);
         $file = axiom_get_file_dir('core/core.options/core.options.txt');
         $url = axiom_get_file_url('core/core.options/core.options.txt');
         $export = serialize($custom_options);
         axiom_fpc($file, $export);
         $response = array('error' => '', 'data' => $export, 'link' => $url);
         echo json_encode($response);
     } else {
         update_option('axiom_options', apply_filters('axiom_filter_save_options', $custom_options, $override));
     }
     die;
 }
Пример #27
0
 function axiom_get_twitter_data($cfg)
 {
     $data = get_transient("twitter_data_" . $cfg['mode']);
     if (!$data) {
         require_once axiom_get_file_dir('lib/tmhOAuth/tmhOAuth.php');
         $tmhOAuth = new tmhOAuth(array('consumer_key' => $cfg['consumer_key'], 'consumer_secret' => $cfg['consumer_secret'], 'token' => $cfg['token'], 'secret' => $cfg['secret']));
         $code = $tmhOAuth->user_request(array('url' => $tmhOAuth->url(axiom_get_twitter_mode_url($cfg['mode']))));
         if ($code == 200) {
             $data = json_decode($tmhOAuth->response['response'], true);
             if (isset($data['status'])) {
                 $code = $tmhOAuth->user_request(array('url' => $tmhOAuth->url(axiom_get_twitter_mode_url($cfg['oembed'])), 'params' => array('id' => $data['status']['id_str'])));
                 if ($code == 200) {
                     $data = json_decode($tmhOAuth->response['response'], true);
                 }
             }
             set_transient("twitter_data_" . $cfg['mode'], $data, 60 * 60);
         }
     } else {
         if (!is_array($data) && axiom_substr($data, 0, 2) == 'a:') {
             $data = unserialize($data);
         }
     }
     return $data;
 }
Пример #28
0
if (axiom_get_custom_option('show_menu_user') == 'yes') {
    ?>
					<div class="menu_user_wrap">
						<div class="content_wrap clearfix">

							<?php 
    if (axiom_get_custom_option('show_left_panel') == 'yes') {
        ?>
								<div class="sidemenu_button"><i class="icon-menu-1"></i></div>
							<?php 
    }
    ?>

							<div class="menu_user_area menu_user_right menu_user_nav_area">
								<?php 
    require_once axiom_get_file_dir('templates/parts/user-panel.php');
    ?>
							</div>

							<?php 
    if (axiom_get_theme_option('show_emergency_phone') == 'yes' && axiom_get_theme_option('emergency_phone') != '') {
        echo '<div class="emergency_phone">' . __('Emergency call:', 'axiom') . ' ' . axiom_get_theme_option('emergency_phone') . '</div>';
    }
    ?>

							<?php 
    if (axiom_get_custom_option('show_contact_info') == 'yes') {
        ?>
							<div class="menu_user_area menu_user_left menu_user_contact_area"><?php 
        echo axiom_get_custom_option('work_hours') ? '<span class="work_hours"> ' . axiom_get_custom_option('work_hours') . '</span>' : '';
        ?>
Пример #29
0
    function axiom_template_single_standard_output($post_options, $post_data)
    {
        $post_data['post_views']++;
        $avg_author = 0;
        $avg_users = 0;
        if (!$post_data['post_protected'] && $post_options['reviews'] && axiom_get_custom_option('show_reviews') == 'yes') {
            $avg_author = $post_data['post_reviews_author'];
            $avg_users = $post_data['post_reviews_users'];
        }
        $show_title = axiom_get_custom_option('show_post_title') == 'yes' && (axiom_get_custom_option('show_post_title_on_quotes') == 'yes' || !in_array($post_data['post_format'], array('aside', 'chat', 'status', 'link', 'quote')));
        $title_tag = axiom_get_custom_option('show_page_top') == 'yes' && axiom_get_custom_option('show_page_title') == 'yes' ? 'h3' : 'h1';
        axiom_open_wrapper('<article class="' . join(' ', get_post_class('itemscope' . ' post_item post_item_single' . ' post_featured_' . esc_attr($post_options['post_class']) . ' post_format_' . esc_attr($post_data['post_format']))) . '"' . ' itemscope itemtype="http://schema.org/' . ($avg_author > 0 || $avg_users > 0 ? 'Review' : 'Article') . '">');
        $post_icon = axiom_get_custom_option('show_post_icon') == 'yes' ? '<span class="post_icon ' . esc_attr($post_data['post_icon']) . '"></span>' : '';
        if ($show_title && $post_options['location'] == 'center' && (axiom_get_custom_option('show_page_top') == 'no' || axiom_get_custom_option('show_page_title') == 'no')) {
            ?>
			<<?php 
            echo esc_html($title_tag);
            ?>
 itemprop="<?php 
            echo $avg_author > 0 || $avg_users > 0 ? 'itemReviewed' : 'name';
            ?>
" class="post_title entry-title"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</<?php 
            echo esc_html($title_tag);
            ?>
>
		<?php 
        }
        if (!$post_data['post_protected'] && (!empty($post_options['dedicated']) || axiom_get_custom_option('show_featured_image') == 'yes' && $post_data['post_thumb'])) {
            ?>
			<section class="post_featured">
			<?php 
            if (!empty($post_options['dedicated'])) {
                echo $post_options['dedicated'];
            } else {
                axiom_enqueue_popup();
                ?>
				<div class="post_thumb" data-image="<?php 
                echo esc_url($post_data['post_attachment']);
                ?>
" data-title="<?php 
                echo esc_attr($post_data['post_title']);
                ?>
">
					<a class="hover_icon hover_icon_view" href="<?php 
                echo esc_url($post_data['post_attachment']);
                ?>
" title="<?php 
                echo esc_attr($post_data['post_title']);
                ?>
"><?php 
                echo $post_data['post_thumb'];
                ?>
</a>
				</div>
				<?php 
            }
            ?>
			</section>
			<?php 
        }
        if ($show_title && $post_options['location'] != 'center' && (axiom_get_custom_option('show_page_top') == 'no' || axiom_get_custom_option('show_page_title') == 'no')) {
            ?>
			<<?php 
            echo esc_html($title_tag);
            ?>
 itemprop="<?php 
            echo $avg_author > 0 || $avg_users > 0 ? 'itemReviewed' : 'name';
            ?>
" class="post_title entry-title"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</<?php 
            echo esc_html($title_tag);
            ?>
>
			<?php 
        }
        if (!$post_data['post_protected'] && axiom_get_custom_option('show_post_info') == 'yes') {
            $info_parts = array('snippets' => true);
            require axiom_get_file_dir('templates/parts/post-info.php');
        }
        require axiom_get_file_dir('templates/parts/reviews-block.php');
        axiom_open_wrapper('<section class="post_content" itemprop="' . ($avg_author > 0 || $avg_users > 0 ? 'reviewBody' : 'articleBody') . '">');
        // Post content
        if ($post_data['post_protected']) {
            echo $post_data['post_excerpt'];
            echo get_the_password_form();
        } else {
            global $AXIOM_GLOBALS;
            if (axiom_strpos($post_data['post_content'], axiom_sc_reviews_placeholder()) === false) {
                $post_data['post_content'] = do_shortcode('[trx_reviews]') . $post_data['post_content'];
            }
            echo trim(axiom_sc_gap_wrapper(axiom_sc_reviews_wrapper($post_data['post_content'])));
            require axiom_get_file_dir('templates/parts/single-pagination.php');
            if (axiom_get_custom_option('show_post_tags') == 'yes' && !empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links)) {
                ?>
				<div class="post_info post_info_bottom">
					<span class="post_info_item post_info_tags"><?php 
                _e('Tags:', 'axiom');
                ?>
 <?php 
                echo join(', ', $post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links);
                ?>
</span>
				</div>
				<?php 
            }
        }
        axiom_close_wrapper();
        // .post_content
        if (!$post_data['post_protected']) {
            if ($post_data['post_edit_enable']) {
                require axiom_get_file_dir('templates/parts/editor-area.php');
            }
            require axiom_get_file_dir('templates/parts/author-info.php');
            require axiom_get_file_dir('templates/parts/share.php');
        }
        $sidebar_present = !axiom_sc_param_is_off(axiom_get_custom_option('show_sidebar_main'));
        if (!$sidebar_present) {
            axiom_close_wrapper();
        }
        // .post_item
        require axiom_get_file_dir('templates/parts/related-posts.php');
        if ($sidebar_present) {
            axiom_close_wrapper();
        }
        // .post_item
        if (!$post_data['post_protected']) {
            require axiom_get_file_dir('templates/parts/comments.php');
        }
        require axiom_get_file_dir('templates/parts/views-counter.php');
    }
Пример #30
0
 /**
  * How to display the widget on the screen.
  */
 function widget($args, $instance)
 {
     extract($args);
     global $wp_query, $post;
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
     $title_tabs = array(isset($instance['title_popular']) ? $instance['title_popular'] : '', isset($instance['title_commented']) ? $instance['title_commented'] : '', isset($instance['title_liked']) ? $instance['title_liked'] : '');
     $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post';
     $category = isset($instance['category']) ? (int) $instance['category'] : 0;
     $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type);
     $number = isset($instance['number']) ? (int) $instance['number'] : '';
     $show_date = isset($instance['show_date']) ? (int) $instance['show_date'] : 0;
     $show_image = isset($instance['show_image']) ? (int) $instance['show_image'] : 0;
     $show_author = isset($instance['show_author']) ? (int) $instance['show_author'] : 0;
     $show_counters = isset($instance['show_counters']) && $instance['show_counters'] > 0 ? axiom_get_theme_option('blog_counters') : '';
     $tabs = array();
     for ($i = 0; $i < 3; $i++) {
         $args = array('post_type' => $post_type, 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'post_password' => '', 'posts_per_page' => $number, 'ignore_sticky_posts' => 1, 'order' => 'DESC');
         if ($i == 0) {
             // Most popular
             $args['meta_key'] = 'post_views_count';
             $args['orderby'] = 'meta_value_num';
             $show_counters = $show_counters ? 'views' : '';
         } else {
             if ($i == 2) {
                 // Most liked
                 $args['meta_key'] = 'post_likes_count';
                 $args['orderby'] = 'meta_value_num';
                 $show_counters = $show_counters ? 'likes' : '';
             } else {
                 // Most commented
                 $args['orderby'] = 'comment_count';
                 $show_counters = $show_counters ? 'comments' : '';
             }
         }
         if ($category > 0) {
             if ($taxonomy == 'category') {
                 $args['cat'] = $category;
             } else {
                 $args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $category));
             }
         }
         $ex = axiom_get_theme_option('exclude_cats');
         if (!empty($ex)) {
             $args['category__not_in'] = explode(',', $ex);
         }
         query_posts($args);
         /* Loop posts */
         if (have_posts()) {
             $post_number = 0;
             $output = '[trx_tab title="' . esc_attr($title_tabs[$i]) . '"]';
             while (have_posts()) {
                 the_post();
                 $post_number++;
                 require axiom_get_file_dir('templates/parts/widgets-posts.php');
                 if ($post_number >= $number) {
                     break;
                 }
             }
             $tabs[] = $output . '[/trx_tab]';
         }
     }
     /* Restore main wp_query and current post data in the global var $post */
     wp_reset_query();
     wp_reset_postdata();
     if (count($tabs) > 0) {
         /* Before widget (defined by themes). */
         echo $before_widget;
         /* Display the widget title if one was input (before and after defined by themes). */
         if ($title) {
             echo $before_title . $title . $after_title;
         }
         echo do_shortcode('[trx_tabs style="2"]' . join($tabs) . '[/trx_tabs]');
         /* After widget (defined by themes). */
         echo $after_widget;
     }
 }