Exemple #1
0
<?php

/*
Template Name: Attachment page
*/
get_header();
$counters = get_theme_option("blog_counters");
$blog_style = 'fullpost';
//get_custom_option('blog_style');
while (have_posts()) {
    the_post();
    // Move setPostViews to the javascript - counter will work under cache system
    if (get_theme_option('use_ajax_views_counter') == 'no') {
        setPostViews(get_the_ID());
    }
    showPostLayout(array('layout' => 'attachment', 'thumb_size' => $blog_style, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth')), 'categories_list' => false, 'tags_list' => false));
}
get_footer();
    if ($post_data['post_format'] != '' && $post_data['post_format'] != 'standard') {
        $args['tax_query'] = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-' . $post_data['post_format']));
    }
    $args = addSortOrderInQuery($args, get_custom_option('post_related_sort'), get_custom_option('post_related_order'));
    $recent_posts = wp_get_recent_posts($args, OBJECT);
    if (is_array($recent_posts) && count($recent_posts) > 0) {
        ?>
		<section class="related_posts<?php 
        echo get_custom_option("show_post_comments") == 'yes' ? ' divider' : '';
        ?>
">
			<h2><?php 
        _e('Related posts', 'themerex');
        ?>
</h2>
			<div class="relatedPostWrap">
				<div class="columnsWrap">
		<?php 
        $i = 0;
        foreach ($recent_posts as $recent) {
            $i++;
            showPostLayout(array('layout' => 'related', 'number' => $i, 'add_view_more' => false, 'posts_on_page' => get_custom_option('post_related_count')), getPostData(array('thumb_size' => 'image_medium', 'strip_teaser' => false, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth'))), $recent));
        }
        ?>
			   </div>
			</div>
			<div class="sc_divider"></div>
		</section>
		<?php 
    }
}
Exemple #3
0
 function themerex_callback_view_more_posts()
 {
     global $_REQUEST, $post, $wp_query;
     if (!wp_verify_nonce($_REQUEST['nonce'], 'ajax_nonce')) {
         die;
     }
     $response = array('error' => '', 'data' => '', 'no_more_data' => 0);
     $page = $_REQUEST['page'];
     $args = unserialize(stripslashes($_REQUEST['data']));
     $vars = unserialize(stripslashes($_REQUEST['vars']));
     if ($page > 0 && is_array($args) && is_array($vars)) {
         extract($vars);
         $args['page'] = $page;
         $args['paged'] = $page;
         $args['ignore_sticky_posts'] = 1;
         if (!isset($wp_query)) {
             $wp_query = new WP_Query($args);
         } else {
             query_posts($args);
         }
         $per_page = count($wp_query->posts);
         $response['no_more_data'] = $page >= $wp_query->max_num_pages;
         //$per_page < $ppp;
         $post_number = 0;
         $accent_color = '';
         $response['data'] = '';
         $flt_ids = array();
         while (have_posts()) {
             the_post();
             $post_number++;
             $post_args = array('layout' => in_array(themerex_substr($vars['blog_style'], 0, 7), array('classic', 'masonry', 'portfol')) ? themerex_substr($vars['blog_style'], 0, 7) : $vars['blog_style'], 'number' => $post_number, 'add_view_more' => false, 'posts_on_page' => $per_page, 'thumb_size' => $vars['blog_style'], 'thumb_crop' => themerex_strpos($vars['blog_style'], 'masonry') === false, 'strip_teaser' => false, 'parent_cat_id' => $vars['parent_cat_id'], 'sidebar' => !in_array($vars['show_sidebar_main'], array('none', 'fullwidth')), 'filters' => $vars['filters'], 'hover' => $vars['hover'], 'show' => false);
             $post_data = getPostData($post_args);
             $response['data'] .= showPostLayout($post_args, $post_data);
             if ($vars['filters'] == 'tags') {
                 if (count($post_data['post_tags_list']) > 0) {
                     foreach ($post_data['post_tags_list'] as $tag) {
                         $flt_ids[$tag->term_id] = $tag->name;
                     }
                 }
             }
         }
         $response['filters'] = $flt_ids;
     } else {
         $response['error'] = __('Wrong query arguments', 'themerex');
     }
     echo json_encode($response);
     die;
 }
Exemple #4
0
    if (get_custom_option('show_filters') == 'yes') {
        if (get_custom_option('filter_taxonomy') == 'tags') {
            // Use tags as filter items
            if (count($post_data['post_tags_list']) > 0) {
                foreach ($post_data['post_tags_list'] as $tag) {
                    $flt_ids[$tag->term_id] = $tag->name;
                }
            }
        }
    }
}
if (!$post_number) {
    if (is_search()) {
        showPostLayout(array('layout' => 'no-search-results'), false);
    } else {
        showPostLayout(array('layout' => 'no-articles'), false);
    }
} else {
    // Isotope filters list
    $ppp = (int) get_custom_option('posts_per_page');
    $filters = '';
    if (get_custom_option('show_filters') == 'yes') {
        if (get_custom_option('filter_taxonomy') == 'categories') {
            // Use categories as filter items
            $cat_id = (int) get_query_var('cat');
            $portfolio_parent = max(0, is_category() ? getParentCategoryByProperty($cat_id, 'show_filters', 'yes') : 0);
            $args2 = array('type' => 'post', 'child_of' => $portfolio_parent, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 0, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => 'category', 'pad_counts' => false);
            $portfolio_list = get_categories($args2);
            if (count($portfolio_list) > 0) {
                $filters .= '<li class="squareButton' . ($portfolio_parent == $cat_id ? ' active' : '') . '"><a href="#" data-filter="*">' . __('All', 'themerex') . '</a></li>';
                foreach ($portfolio_list as $cat) {
Exemple #5
0
function sc_blogger($atts, $content = null)
{
    if (in_shortcode_blogger(true)) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "class" => "", "style" => "regular", "filters" => "no", "ids" => "", "cat" => "", "count" => "3", "visible" => "", "offset" => "", "orderby" => "date", "order" => "desc", "only" => "no", "descr" => "0", "readmore" => "", "loadmore" => "no", "location" => "default", "dir" => "horizontal", "hover" => get_theme_option('hover_style'), "hover_dir" => get_theme_option('hover_dir'), "scroll" => "no", "controls" => "no", "rating" => "no", "info" => "yes", "links" => "yes", "date_format" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    $s = getStyleString($top, $right, $bottom, $left, $width, $height);
    $width = getStyleValue($width);
    $height = getStyleValue($height);
    global $THEMEREX_sc_blogger_busy, $THEMEREX_sc_blogger_counter, $post;
    $THEMEREX_sc_blogger_busy = true;
    $THEMEREX_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 (!in_array($style, array('regular', 'date', 'image_large', 'image_medium', 'image_small', 'image_tiny', 'accordion_1', 'accordion_2', 'list', 'excerpt', 'related')) && !in_array(themerex_substr($style, 0, 7), array('classic', 'masonry', 'portfol'))) {
        $style = 'regular';
    }
    if (!empty($ids)) {
        $posts = explode(',', str_replace(' ', '', $ids));
        $count = count($posts);
    }
    if (in_array($style, array('accordion_1', 'accordion_2', 'list'))) {
        $dir = 'vertical';
    }
    if ($visible <= 0) {
        $visible = min(4, $count);
    }
    if (sc_param_is_on($scroll) && empty($id)) {
        $id = 'sc_blogger_' . str_replace('.', '', mt_rand());
    }
    $output = ($style == 'list' ? '<ul' : '<div') . ($id ? ' id="' . $id . '"' : '') . ' class="sc_blogger' . (!empty($class) ? ' ' . $class : '') . ' sc_blogger_' . ($dir == 'vertical' ? 'vertical' : 'horizontal') . ' style_' . (in_array($style, array('accordion_1', 'accordion_2')) ? 'accordion' : (themerex_strpos($style, 'image') !== false ? 'image style_' : '') . $style) . (in_array($style, array('accordion_1', 'accordion_2')) ? ' sc_accordion' : '') . ($style == 'accordion_1' ? ' sc_accordion_style_1' : '') . ($style == 'accordion_2' ? ' sc_accordion_style_2' : '') . (themerex_strpos($style, 'masonry') !== false || themerex_strpos($style, 'classic') !== false ? ' masonryWrap' : '') . (themerex_strpos($style, 'portfolio') !== false ? ' portfolioWrap' : '') . ($style == 'related' ? ' relatedPostWrap' : '') . (sc_param_is_on($scroll) && sc_param_is_on($controls) ? ' sc_scroll_controls sc_scroll_controls_' . $dir : '') . ($descr == 0 ? ' no_description' : '') . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>' . ($dir != 'vertical' && $style != 'date' && !in_array(themerex_substr($style, 0, 7), array('classic', 'masonry', 'portfol', 'excerpt')) ? '<div class="columnsWrap">' : '') . (sc_param_is_on($scroll) ? '<div id="' . $id . '_scroll" class="sc_scroll sc_scroll_' . $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 (themerex_strpos($style, 'masonry') !== false || themerex_strpos($style, 'classic') !== false) {
        if (!sc_param_is_off($filters)) {
            $output .= '<div class="isotopeFiltr"></div>';
        }
        $output .= '<section class="masonry ' . (!sc_param_is_off($filters) ? 'isotope' : 'isotopeNOanim') . '" data-columns="' . themerex_substr($style, -1) . '">';
    } else {
        if (themerex_strpos($style, 'portfolio') !== false) {
            if (!sc_param_is_off($filters)) {
                $output .= '<div class="isotopeFiltr"></div>';
            }
            $output .= '<section class="portfolio ' . (!sc_param_is_off($filters) ? 'isotope' : 'isotopeNOanim') . ' folio' . themerex_substr($style, -1) . 'col" data-columns="' . themerex_substr($style, -1) . '">';
        }
    }
    $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 = addSortOrderInQuery($args, $orderby, $order);
    if (!sc_param_is_off($only)) {
        $args = addFiltersInQuery($args, array($only));
    }
    $args = addPostsAndCatsInQuery($args, $ids, $cat);
    $query = new WP_Query($args);
    $flt_ids = array();
    while ($query->have_posts()) {
        $query->the_post();
        $THEMEREX_sc_blogger_counter++;
        $args = array('layout' => in_array(themerex_substr($style, 0, 7), array('classic', 'masonry', 'portfol', 'excerpt', 'related')) ? themerex_substr($style, 0, 7) : 'blogger', 'show' => false, 'number' => $THEMEREX_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" => sc_param_is_on($rating), "dir" => $dir, "scroll" => sc_param_is_on($scroll), "info" => sc_param_is_on($info), "links" => sc_param_is_on($links), "orderby" => $orderby, "posts_visible" => $visible, "date_format" => $date_format, 'thumb_size' => $style, 'thumb_crop' => themerex_strpos($style, 'masonry') === false, 'strip_teaser' => false, "categories_list" => in_array($style, array('excerpt')) || $filters == 'categories', "tags_list" => in_array(themerex_substr($style, 0, 7), array('classic', 'masonry', 'portfol', 'related')) || $filters == 'tags', 'filters' => sc_param_is_off($filters) ? '' : $filters, 'hover' => $hover, 'hover_dir' => $hover_dir);
        $post_data = getPostData($args);
        $output .= showPostLayout($args, $post_data);
        if (!sc_param_is_off($filters)) {
            if ($filters == 'tags') {
                // Use tags as filter items
                if (count($post_data['post_tags_list']) > 0) {
                    foreach ($post_data['post_tags_list'] as $tag) {
                        $flt_ids[$tag->term_id] = $tag->name;
                    }
                }
            }
        }
    }
    wp_reset_postdata();
    if (in_array(themerex_substr($style, 0, 7), array('classic', 'masonry', 'portfol'))) {
        if (themerex_strpos($style, 'masonry') !== false || themerex_strpos($style, 'classic') !== false) {
            $output .= '</section>';
        } else {
            if (themerex_strpos($style, 'portfolio') !== false) {
                $output .= '</section>';
            }
        }
        // Isotope filters list
        $filters_list = '';
        if (!sc_param_is_off($filters)) {
            if ($filters == 'categories') {
                // Use categories as filter items
                $portfolio_parent = max(0, getParentCategoryByProperty($cat, 'show_filters', 'yes'));
                $args2 = array('type' => 'post', 'child_of' => $portfolio_parent, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 0, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => 'category', 'pad_counts' => false);
                $portfolio_list = get_categories($args2);
                if (count($portfolio_list) > 0) {
                    $filters_list .= '<li class="squareButton' . ($portfolio_parent == $cat_id ? ' active' : '') . '"><a href="#" data-filter="*">' . __('All', 'themerex') . '</a></li>';
                    foreach ($portfolio_list as $cat) {
                        $filters_list .= '<li class="squareButton' . ($cat->term_id == $cat_id ? ' active' : '') . '"><a href="#" data-filter=".flt_' . $cat->term_id . '">' . $cat->name . '</a></li>';
                    }
                }
            } else {
                // Use tags as filter items
                if (count($flt_ids) > 0) {
                    $filters_list .= '<li class="squareButton active"><a href="#" data-filter="*">' . __('All', 'themerex') . '</a></li>';
                    foreach ($flt_ids as $flt_id => $flt_name) {
                        $filters_list .= '<li class="squareButton"><a href="#" data-filter=".flt_' . $flt_id . '">' . $flt_name . '</a></li>';
                    }
                }
            }
            if ($filters_list) {
                $output .= '<script type="text/javascript">' . 'jQuery(document).ready(function () {' . 'jQuery("#' . $id . ' .isotopeFiltr").append("<ul>' . addslashes($filters_list) . '</ul>");' . '});' . '</script>';
            }
        }
    }
    $output .= (sc_param_is_on($scroll) ? '</div></div><div id="' . $id . '_scroll_bar" class="sc_scroll_bar sc_scroll_bar_' . $dir . ' ' . $id . '_scroll_bar"></div></div>' . (sc_param_is_on($controls) ? '<ul class="flex-direction-nav"><li><a class="flex-prev" href="#"></a></li><li><a class="flex-next" href="#"></a></li></ul>' : '') : '') . ($dir != 'vertical' && $style != 'date' && !in_array(themerex_substr($style, 0, 7), array('classic', 'masonry', 'portfol', 'excerpt')) ? '</div>' : '') . ($style == 'list' ? '</ul>' : '</div>');
    if (in_array($style, array('accordion_1', 'accordion_2'))) {
        themerex_enqueue_script('jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true);
    }
    $THEMEREX_sc_blogger_busy = false;
    return $output;
}
                themerex_enqueue_style('prettyphoto-style', themerex_get_file_url('/js/prettyphoto/css/prettyPhoto.css'), array(), null);
                themerex_enqueue_script('prettyphoto', themerex_get_file_url('/js/prettyphoto/jquery.prettyPhoto.min.js'), array('jquery'), 'no-compose', true);
            }
        }
        ?>
		<section class="relatedWrap<?php 
        echo get_custom_option("show_post_comments") == 'yes' ? ' hrShadow' : '';
        ?>
">
			<h3><?php 
        _e('Recomended Posts', 'themerex');
        ?>
</h3>
			<div class="relatedPostWrap">
				<div class="columnsWrap <?php 
        echo get_custom_option("post_related_style") == 'no' ? ' no_indent_style columnsFloat' : ' indent_style';
        ?>
">
				<?php 
        $i = 0;
        foreach ($recent_posts as $recent) {
            $i++;
            showPostLayout(array('layout' => 'related', 'number' => $i, 'add_view_more' => false, 'posts_on_page' => get_custom_option('post_related_count'), 'posts_visible' => max(1, min(4, count($recent_posts))), 'thumb_size' => 'classic' . max(1, min(4, count($recent_posts))), 'strip_teaser' => false, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth')), 'categories_list' => false, 'tags_list' => true), null, $recent);
        }
        ?>
			   </div>
			</div>
		</section>
		<?php 
    }
}
function sc_blogger($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "style" => "regular", "ids" => "", "cat" => "", "count" => "3", "visible" => "", "offset" => "", "orderby" => "date", "order" => "desc", "descr" => "0", "readmore" => "", "dir" => "horizontal", "rating" => "no", "scroll" => "no", "info" => "yes", "width" => "-1", "height" => "-1", "top" => "", "bottom" => "", "left" => "", "right" => "", "title" => "", "link_title" => "", "link_url" => "", "border" => ""), $atts));
    $ed = themerex_substr($width, -1) == '%' ? '%' : 'px';
    $width = (int) str_replace('%', '', $width);
    $s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '') . ($width > 0 ? 'width:' . $width . $ed . ';' : '') . ($height > 0 && $style == 'carousel' ? 'max-height:' . $height . 'px' : '') . ($height > 0 ? 'height:' . $height . 'px;' : '');
    global $THEMEREX_sc_blogger_busy, $THEMEREX_sc_blogger_counter, $post;
    $THEMEREX_sc_blogger_busy = true;
    $THEMEREX_sc_blogger_counter = 0;
    if (!in_array($style, array('regular', 'date', 'image_large', 'image_medium', 'image_small', 'default', 'accordion', 'list', 'classic', 'date', 'carousel'))) {
        $style = 'regular';
    }
    if (!empty($ids)) {
        $posts = explode(',', str_replace(' ', '', $ids));
        $count = count($posts);
    }
    if ($visible <= 0) {
        $visible = $count;
    }
    if (sc_param_is_on($scroll) && empty($id)) {
        $id = 'sc_blogger_' . str_replace('.', '', mt_rand());
    }
    $block_link = !empty($link_title) && !empty($link_url) ? '<a class="sc_blogger_block_link" href="' . $link_url . '">' . $link_title . '</a>' : '';
    $output = '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_blogger' . ' sc_blogger_' . ($dir == 'vertical' ? 'vertical' : 'horizontal') . ' style_' . (in_array($style, array('accordion_1', 'accordion_2')) ? 'accordion' : (themerex_strpos($style, 'image') !== false ? 'image style_' : '') . $style) . (in_array($style, array('accordion_1', 'accordion_2')) ? ' sc_accordion' : '') . (themerex_strpos($style, 'portfolio') !== false ? ' portfolioWrap' : '') . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>' . (!empty($block_link) && !empty($title) ? $block_link : '') . (!empty($title) ? '<h2 class="sc_blogger_block_title">' . $title . '</h2>' : '') . ($dir != 'vertical' && $style != 'date' && $style != 'accordion' && $style != 'list' && $style != 'carousel' ? '<div class="columnsWrap">' : '<div class="sc_' . $style . ($style == 'carousel' ? ' swiper-wrapper' : '') . '">');
    $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 = addSortOrderInQuery($args, $orderby, $order);
    $args = addPostsAndCatsInQuery($args, $ids, $cat);
    if ($style == 'image_large') {
        $thumb_style = 'excerpt';
    } else {
        if ($style == 'image_small' || $style == 'image_medium') {
            $thumb_style = 'image_medium';
        } else {
            if ($style == 'regular' || $style == 'default') {
                $thumb_style = 'regular';
            } else {
                if ($style == 'carousel') {
                    $thumb_style = 'carousel';
                } else {
                    $thumb_style = 'blogger';
                }
            }
        }
    }
    if (in_array($style, array('image_large', 'image_small', 'image_medium', 'regular', 'default'))) {
        $layout = 'blogger';
    } else {
        if ($style == 'date') {
            $layout = 'blogger_date';
        } else {
            if ($style == 'accordion') {
                $layout = 'blogger_accordion';
            } else {
                if ($style == 'list') {
                    $layout = 'blogger_list';
                } else {
                    if ($style == 'carousel') {
                        $layout = 'blogger_carousel';
                    } else {
                        // If Layout style == excerpt
                        $layout = 'blogger_style_2';
                    }
                }
            }
        }
    }
    $query = new WP_Query($args);
    $found = $query->found_posts;
    while ($query->have_posts()) {
        $query->the_post();
        $THEMEREX_sc_blogger_counter++;
        $output .= showPostLayout(array('layout' => $layout, 'show' => false, 'number' => $THEMEREX_sc_blogger_counter, 'add_view_more' => false, 'posts_on_page' => $count, "reviews" => sc_param_is_on($rating), 'thumb_size' => $thumb_style, 'thumb_crop' => themerex_strpos($style, 'masonry') === false, 'strip_teaser' => false, "descr" => $descr, "readmore" => $readmore, "dir" => $dir, "scroll" => sc_param_is_on($scroll), "info" => sc_param_is_on($info), "orderby" => $orderby, "posts_visible" => $visible, "categories_list" => true, "style" => $style, "tags_list" => false, "border" => $border, "found" => $found));
    }
    wp_reset_postdata();
    $output .= '</div>';
    $output .= $style == 'carousel' ? '<a href="#" class="prev_slide"><i class="icon-left-open-big"></i></a><a href="#" class="next_slide"><i class="icon-right-open-big"></i></a><div class="swiper_scrollbar"></div>' : '';
    $output .= empty($title) && !empty($block_link) ? '<div class="sc_blogger_link_after">' . $block_link . '</div>' : '';
    $output .= '</div>';
    $THEMEREX_sc_blogger_busy = false;
    if ($style == 'accordion') {
        wp_enqueue_script('jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true);
    }
    return $output;
}
        $args['category__in'] = $post_data['post_categories_ids'];
    }
    // Uncomment this section if you want filter related posts on post formats
    if ($post_data['post_format'] != '' && $post_data['post_format'] != 'standard') {
        $args['tax_query'] = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-' . $post_data['post_format']));
    }
    $args = addSortOrderInQuery($args, get_custom_option('post_related_sort'), get_custom_option('post_related_order'));
    $recent_posts = wp_get_recent_posts($args, OBJECT);
    if (is_array($recent_posts) && count($recent_posts) > 0) {
        ?>
		<section class="related">
			<h3><?php 
        _e('Related posts', 'themerex');
        ?>
</h3>
			<div class="sc_columns_<?php 
        echo esc_attr($columns);
        ?>
 postBox">
				<?php 
        $i = 0;
        foreach ($recent_posts as $recent) {
            $i++;
            showPostLayout(array('layout' => 'related', 'number' => $i, 'add_view_more' => false, 'posts_on_page' => get_custom_option('post_related_count')), getPostData(array('thumb_size' => getThumbColumns('cub', $columns), 'strip_teaser' => false, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth')), 'categories_list' => true), $recent));
        }
        ?>
			</div>
		</section>
		<?php 
    }
}
<?php

/**
 * The Template for displaying all single posts.
 */
get_header();
$counters = get_theme_option("blog_counters");
$allow_editor = get_theme_option("allow_editor") == 'yes';
$page_style = get_custom_option('single_style');
while (have_posts()) {
    the_post();
    // Move setPostViews to the javascript - counter will work under cache system
    if (get_theme_option('use_ajax_views_counter') == 'no') {
        setPostViews(get_the_ID());
    }
    //clear_dedicated_content();
    showPostLayout(array('layout' => esc_attr($page_style), 'thumb_size' => esc_attr($page_style), 'thumb_crop' => false, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth')), 'content' => true));
}
get_footer();
Exemple #10
0
<?php

/**
 * The Template for displaying all single posts.
 *
 * @package RockGroup
 */
get_header();
$counters = get_theme_option("blog_counters");
//$allow_editor = get_theme_option("allow_editor")=='yes';
$page_style = 'single-standard';
while (have_posts()) {
    the_post();
    // Move setPostViews to the javascript - counter will work under cache system
    if (get_theme_option('use_ajax_views_counter') == 'no') {
        setPostViews(get_the_ID());
    }
    //clear_dedicated_content();
    showPostLayout(array('layout' => $page_style, 'thumb_size' => 'image_large', 'thumb_crop' => false, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth'))));
}
get_footer();
 function themerex_callback_blog_portfolio_single()
 {
     global $_REQUEST;
     if (!wp_verify_nonce($_REQUEST['nonce'], 'ajax_nonce')) {
         die;
     }
     $response = array('error' => '');
     $post_id = $_REQUEST['post_id'];
     if (!empty($post_id)) {
         $post_obj = get_post($post_id);
         $opt = array('show' => false, 'thumb_size' => 'portfolio', 'layout' => 'part-portfolio');
         $response['data'] = showPostLayout($opt, NULL, $post_obj);
     } else {
         $response['error'] = __('Requested post cannot be loaded.', 'themerex');
     }
     echo json_encode($response);
     die;
 }
Exemple #12
0
 function themerex_isotope_content()
 {
     global $_REQUEST;
     //, $post, $wp_query;
     if (!wp_verify_nonce($_REQUEST['nonce'], 'ajax_nonce')) {
         die;
     }
     $response = array('data' => '');
     $postID = stripslashes($_REQUEST['postID']);
     $get_post_content = get_post($postID);
     $post_layout = showPostLayout(array('layout' => 'excerpt', 'layout_isotope' => true, 'thumb_size' => 'image_large', 'thumb_crop' => true, 'sidebar' => false, 'show' => false), null, $get_post_content);
     if ($get_post_content != '') {
         $response['data'] = $post_layout;
     } else {
         $response['data'] = do_shortcode('[trx_infobox style="error" closeable="no"  title="' . __('Error', 'themerex') . '" bottom="40" top="40"]' . __('Content upload error occured', 'themerex') . '[/trx_infobox]');
     }
     echo json_encode($response);
     die;
 }
Exemple #13
0
function sc_blogger($atts, $content = null)
{
    if (in_shortcode_blogger(true)) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "style" => "regular", "filters" => "no", "ids" => "", "cat" => "", "indent" => "yes", "count" => "3", "visible" => "", "offset" => "", "orderby" => "date", "order" => "desc", "descr" => "0", "readmore" => "", "location" => "default", "dir" => "horizontal", "scroll" => "no", "rating" => "no", "info" => "yes", "width" => "-1", "height" => "-1", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    /*scripts & styles*/
    themerex_enqueue_style('swiperslider-style', get_template_directory_uri() . '/js/swiper/idangerous.swiper.css', array(), null);
    themerex_enqueue_script('swiperslider', get_template_directory_uri() . '/js/swiper/idangerous.swiper-2.1.js', array('jquery'), null, true);
    themerex_enqueue_style('swiperslider-scrollbar-style', get_template_directory_uri() . '/js/swiper/idangerous.swiper.scrollbar.css', array(), null);
    themerex_enqueue_script('swiperslider-scrollbar', get_template_directory_uri() . '/js/swiper/idangerous.swiper.scrollbar-2.1.js', array('jquery'), null, true);
    $count = min(6, max(1, $count));
    $ed = themerex_substr($width, -1) == '%' ? '%' : 'px';
    $width = (int) str_replace('%', '', $width);
    $s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '') . ($width > 0 ? 'width:' . $width . $ed . ';' : '') . ($height > 0 ? 'height:' . $height . 'px;' : '');
    $c = ' sc_blogger_' . ($dir == 'vertical' ? 'vertical' : 'horizontal') . ' style_' . (in_array($style, array('accordion_1', 'accordion_2', 'accordion_3')) ? 'accordion' : (themerex_strpos($style, 'image') !== false ? 'image style_' : '') . $style) . (in_array($style, array('accordion_1', 'accordion_2', 'accordion_3')) ? ' sc_toggl sc_accordion_init sc_toggl_icon_show sc_toggl_icon_right' : '') . ($style == 'accordion_1' ? ' sc_toggl_style_1' : '') . ($style == 'accordion_2' ? ' sc_toggl_style_2' : '') . ($style == 'accordion_3' ? ' sc_toggl_style_3' : '') . (themerex_strpos($style, 'masonry') !== false || themerex_strpos($style, 'classic') !== false ? ' masonryWrap' : '') . (themerex_strpos($style, 'portfolio') !== false ? ' portfolioWrap' : '') . ($style == 'related' ? ' relatedPostWrap' : '') . ($indent == 'yes' ? ' sc_blogger_indent' : '');
    global $THEMEREX_sc_blogger_busy, $THEMEREX_sc_blogger_counter, $post;
    $THEMEREX_sc_blogger_busy = true;
    $THEMEREX_sc_blogger_counter = 0;
    if (!in_array($style, array('regular', 'date', 'image_large', 'image_medium', 'image_small', 'image_tiny', 'accordion_1', 'accordion_2', 'accordion_3', 'list', 'classic', 'masonry', 'portfolio', 'excerpt', 'related'))) {
        $style = 'regular';
    }
    if (!empty($ids)) {
        $posts = explode(',', str_replace(' ', '', $ids));
        $count = count($posts);
    }
    if (in_array($style, array('accordion_1', 'accordion_2', 'accordion_3', 'list'))) {
        $dir = 'vertical';
    }
    if ($visible <= 0) {
        $visible = $count;
    }
    if (sc_param_is_on($scroll) && empty($id)) {
        $id = 'sc_blogger_' . str_replace('.', '', mt_rand());
    }
    $output = ($style == 'list' ? '<ul' : '<div') . ($id ? ' id="sc_blogger_' . $id . '"' : '') . ' class="sc_blogger' . $c . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>' . ($dir != 'vertical' && $count > 1 ? '<div class="sc_columns_' . $visible . ($indent == 'yes' ? ' sc_columns_indent' : '') . '">' : '') . (sc_param_is_on($scroll) ? '<div id="sc_blogger_' . $id . '_scroll" class="sc_scroll sc_scroll_' . $dir . ' swiper-container scroll-container"' . ' style="' . ($dir == 'vertical' ? 'height:' . ($height > 0 ? $height : "230") . 'px;' : 'width:' . ($width > 0 ? $width . 'px;' : "100%;")) . '"' . '>' . '<div class="sc_scroll_wrapper swiper-wrapper">' : '');
    if (themerex_strpos($style, 'masonry') !== false || themerex_strpos($style, 'classic') !== false) {
        $output .= '<section class="masonry ' . (sc_param_is_on($filters) ? 'isotope' : 'isotopeNOamin') . '" data-columns="' . themerex_substr($style, -1) . '">';
    }
    $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 = addSortOrderInQuery($args, $orderby, $order);
    $args = addPostsAndCatsInQuery($args, $ids, $cat);
    $query = new WP_Query($args);
    while ($query->have_posts()) {
        $query->the_post();
        $THEMEREX_sc_blogger_counter++;
        $output .= showPostLayout(array('layout' => in_array(themerex_substr($style, 0, 7), array('classic', 'masonry', 'portfol', 'excerpt', 'related')) ? themerex_substr($style, 0, 7) : 'blogger', 'show' => false, 'number' => $THEMEREX_sc_blogger_counter, 'add_view_more' => false, 'posts_on_page' => $count, "reviews" => sc_param_is_on($rating), 'thumb_size' => $style, 'thumb_crop' => themerex_strpos($style, 'masonry') === false, 'strip_teaser' => false, "location" => $location, "descr" => $descr, "readmore" => $readmore, "dir" => $dir, "scroll" => sc_param_is_on($scroll), "info" => sc_param_is_on($info), "orderby" => $orderby, "posts_visible" => $visible, "categories_list" => in_array($style, array('excerpt')), "tags_list" => false));
    }
    wp_reset_postdata();
    if (themerex_strpos($style, 'masonry') !== false || themerex_strpos($style, 'classic') !== false) {
        $output .= '</section>';
    }
    $output .= (sc_param_is_on($scroll) ? '</div><div id="' . $id . '_scroll_bar" class="sc_scroll_bar sc_scroll_bar_' . $dir . ' ' . $id . '_scroll_bar"></div></div>' : '') . ($dir != 'vertical' ? '</div>' : '') . ($style == 'list' ? '</ul>' : '</div>');
    if (in_array($style, array('accordion_1', 'accordion_2'))) {
        themerex_enqueue_script('jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true);
    }
    $THEMEREX_sc_blogger_busy = false;
    return $output;
}
<?php

/**
 * The Template for displaying all single posts.
 *
 * @package spotlight
 */
get_header();
global $wp_query;
while (have_posts()) {
    the_post();
    // Move setPostViews to the javascript - counter will work under cache system
    if (get_theme_option('use_ajax_views_counter') == 'no') {
        setPostViews(get_the_ID());
    }
    clear_dedicated_content();
    showPostLayout(array('layout' => 'single-standard', 'thumb_size' => 'single-standard', 'thumb_crop' => false, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth'))));
}
get_footer();
Exemple #15
0
<?php

/*
Template Name: Page 404
*/
// Tribe Events hack - create empty post object
global $post;
if (!isset($post)) {
    $post = new stdClass();
    $post->post_type = 'unknown';
}
// End Tribe Events hack
get_header();
showPostLayout(array('layout' => '404'), false);
get_footer();