Пример #1
0
			</div>
		</div>
		<?php 
if ($tb_post_show_post_desc) {
    ?>
 
			<div class="ro-sub-content clearfix">
				<?php 
    the_content();
    wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'robusta'), 'after' => '</div>'));
    ?>
			</div>
			<div class="ro-actions clearfix">
				<ul class="pull-left">
					<li><?php 
    post_favorite();
    ?>
</li>
					<li><a href="<?php 
    comments_link();
    ?>
"><?php 
    comments_number('0', '1', '%');
    ?>
 <i class="icon icon-chat"></i> <span>comments</span></a></li>
					<?php 
    $share_all = pssc_facebook(get_the_ID()) + pssc_twitter(get_the_ID()) + pssc_pinterest(get_the_ID());
    ?>
					<li><a href="<?php 
    the_permalink();
    ?>
Пример #2
0
function ro_blog_func($atts, $content = null)
{
    extract(shortcode_atts(array('category' => '', 'posts_per_page' => -1, 'columns' => 3, 'orderby' => 'none', 'order' => 'none', 'el_class' => '', 'img' => '', 'show_title' => 0, 'show_excerpt' => 0, 'excerpt_lenght' => 18, 'excerpt_more' => '... ', 'read_more_text' => '', 'show_meta' => 0, 'show_actions' => 0, 'text_featured' => ''), $atts));
    $class = array();
    $class[] = 'ro-blog-wrapper clearfix';
    $class[] = $el_class;
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $args = array('posts_per_page' => $posts_per_page, 'paged' => $paged, 'orderby' => $orderby, 'order' => $order, 'post_type' => 'post', 'post_status' => 'publish');
    if (isset($category) && $category != '') {
        $cats = explode(',', $category);
        $category = array();
        foreach ((array) $cats as $cat) {
            $category[] = trim($cat);
        }
        $args['tax_query'] = array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => $category));
    }
    $wp_query = new WP_Query($args);
    ob_start();
    if ($wp_query->have_posts()) {
        $class_columns = '';
        switch ($columns) {
            case 1:
                $class_columns = 'col-xs-12 col-sm-12 col-md-12 col-lg-12';
                break;
            case 2:
                $class_columns = 'col-xs-12 col-sm-6 col-md-6 col-lg-6';
                break;
            case 3:
                $class_columns = 'col-xs-12 col-sm-12 col-md-4 col-lg-4';
                break;
            case 4:
                $class_columns = 'col-xs-12 col-sm-6 col-md-3 col-lg-3';
                break;
            default:
                $class_columns = 'col-xs-12 col-sm-6 col-md-3 col-lg-3';
                break;
        }
        ?>
	<div class="<?php 
        echo esc_attr(implode(' ', $class));
        ?>
">
		<div class="row">
			<?php 
        $count = 0;
        while ($wp_query->have_posts()) {
            $wp_query->the_post();
            $count++;
            ?>
				<div class="<?php 
            echo esc_attr($class_columns);
            ?>
">
					<article id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class();
            ?>
>
						<div class="ro-blog-item">
							<?php 
            if ($count == 1 && $text_featured) {
                echo '<span class="ro-first-item">' . esc_html($text_featured) . '</span>';
            }
            ?>
							<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('custom-blog-grid-size');
            }
            ?>
							<div class="ro-content-overlay">
								<?php 
            if ($img) {
                echo '<div class="ro-logo">' . wp_get_attachment_image($img, 'full') . '</div>';
            }
            ?>
								<?php 
            if ($show_title) {
                ?>
									<h6 class="ro-font-size-7"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h6>
								<?php 
            }
            ?>
								<?php 
            if ($show_meta) {
                ?>
									<div class="ro-meta"><?php 
                echo 'By ' . get_the_author() . ' - ' . human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago';
                ?>
</div>
								<?php 
            }
            ?>
								<?php 
            if ($show_excerpt) {
                ?>
									<div class="ro-excerpt">
										<?php 
                echo ro_custom_excerpt($excerpt_lenght, $excerpt_more);
                if ($read_more_text) {
                    echo '<a href="' . get_the_permalink() . '">' . esc_html($read_more_text) . '</a>';
                }
                ?>
									</div>
								<?php 
            }
            ?>
								<?php 
            if ($show_actions) {
                ?>
									<ul>
										<li><?php 
                post_favorite();
                ?>
</li>
										<li><a href="<?php 
                comments_link();
                ?>
"><?php 
                comments_number('0', '1', '%');
                ?>
 <i class="icon icon-chat"></i> <span>comments</span></a></li>
										<?php 
                $share_all = pssc_facebook(get_the_ID()) + pssc_twitter(get_the_ID()) + pssc_pinterest(get_the_ID());
                ?>
										<li><a href="<?php 
                the_permalink();
                ?>
"><?php 
                echo $share_all;
                ?>
 <i class="icon icon-share"></i> <span>shares</span></a></li>
									</ul>
								<?php 
            }
            ?>
							</div>
						</div>
					</article>
				</div>
			<?php 
        }
        ?>
		</div>
	</div>
    <?php 
    }
    return ob_get_clean();
}
Пример #3
0
function ro_blog_list_func($atts, $content = null)
{
    extract(shortcode_atts(array('category' => '', 'posts_per_page' => -1, 'orderby' => 'none', 'order' => 'none', 'show_pagination' => 0, 'el_class' => '', 'show_title' => 0, 'show_excerpt' => 0, 'excerpt_lenght' => 50, 'excerpt_more' => '... ', 'read_more_text' => '', 'show_meta' => 0, 'show_actions' => 0), $atts));
    $class = array();
    $class[] = 'ro-blog-list-wrapper clearfix';
    $class[] = $el_class;
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $args = array('posts_per_page' => $posts_per_page, 'paged' => $paged, 'orderby' => $orderby, 'order' => $order, 'post_type' => 'post', 'post_status' => 'publish');
    if (isset($category) && $category != '') {
        $cats = explode(',', $category);
        $category = array();
        foreach ((array) $cats as $cat) {
            $category[] = trim($cat);
        }
        $args['tax_query'] = array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => $category));
    }
    $wp_query = new WP_Query($args);
    ob_start();
    if ($wp_query->have_posts()) {
        ?>
	<div class="<?php 
        echo esc_attr(implode(' ', $class));
        ?>
">
		<?php 
        while ($wp_query->have_posts()) {
            $wp_query->the_post();
            ?>
			<article id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class();
            ?>
>
				<div class="ro-blog-item">
					<?php 
            if ($show_title) {
                ?>
						<h5 class="clearfix">
							<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a>
							<?php 
                $text_featured = get_post_meta(get_the_ID(), 'tb_text_featured', true);
                if ($text_featured) {
                    echo '<span>' . esc_html($text_featured) . '</span>';
                }
                ?>
						</h5>
					<?php 
            }
            ?>
					<?php 
            if ($show_meta) {
                ?>
						<div class="ro-meta"><?php 
                echo 'By ' . get_the_author() . ' - ' . human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago';
                ?>
</div>
					<?php 
            }
            ?>
					<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('custom-blog-list-size');
            }
            ?>
					<?php 
            if ($show_excerpt) {
                ?>
						<div class="ro-excerpt">
							<?php 
                echo ro_custom_excerpt($excerpt_lenght, $excerpt_more);
                if ($read_more_text) {
                    echo '<a href="' . get_the_permalink() . '">' . esc_html($read_more_text) . '</a>';
                }
                ?>
						</div>
					<?php 
            }
            ?>
					<?php 
            if ($show_actions) {
                ?>
						<div class="ro-actions clearfix">
							<ul class="pull-left">
								<li><?php 
                post_favorite();
                ?>
</li>
								<li><a href="<?php 
                comments_link();
                ?>
"><?php 
                comments_number('0', '1', '%');
                ?>
 <i class="icon icon-chat"></i> <span>comments</span></a></li>
								<?php 
                $share_all = pssc_facebook(get_the_ID()) + pssc_twitter(get_the_ID()) + pssc_pinterest(get_the_ID());
                ?>
								<li><a href="<?php 
                the_permalink();
                ?>
"><?php 
                echo $share_all;
                ?>
 <i class="icon icon-share"></i> <span>shares</span></a></li>
							</ul>
							<ul class="ro-share pull-right">
								<li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php 
                the_permalink();
                ?>
"><i class="icon icon-facebook"></i></a></li>
								<li><a href="https://twitter.com/home?status=<?php 
                the_permalink();
                ?>
"><i class="icon icon-twitter"></i></a></li>
								<li><a href="https://pinterest.com/pin/create/button/?url=<?php 
                the_permalink();
                ?>
"><i class="icon icon-pinterest"></i></a></li>
							</ul>
						</div>
					<?php 
            }
            ?>
					<?php 
            $extra_img = get_post_meta(get_the_ID(), 'tb_extra_img_url', true);
            if ($extra_img) {
                echo '<div class="ro-extra-img"><a href="#"><img alt="extra_img" src="' . esc_url($extra_img) . '"></a></div>';
            }
            ?>
				</div>
			</article>
		<?php 
        }
        ?>
		<div style="clear: both;"></div>
		<?php 
        if ($show_pagination) {
            ?>
			<nav class="ro-pagination <?php 
            echo esc_attr($pos_pagination);
            ?>
" role="navigation">
				<?php 
            $big = 999999999;
            // need an unlikely integer
            echo paginate_links(array('base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages, 'prev_text' => __('<i class="fa fa-angle-left"></i>', 'robusta'), 'next_text' => __('<i class="fa fa-angle-right"></i>', 'robusta')));
            ?>
			</nav>
		<?php 
        }
        ?>
	</div>
    <?php 
    }
    return ob_get_clean();
}
Пример #4
0
?>

					<?php 
if ($show_like == true || $show_like == 1) {
    ?>

						<li>
							<h5><i class="<?php 
    echo $icon_like;
    ?>
"></i> <?php 
    echo $text_like;
    ?>
</h5>
							<?php 
    post_favorite('', 'like', false);
    ?>

						</li>
					<?php 
}
?>

					</ul>
					<?php 
if ($show_share == true || $show_share == 1) {
    ?>

						<h5 class="title-pt"></i><?php 
    echo $text_share;
    ?>
Пример #5
0
function cshero_info_bar_render()
{
    global $smof_data, $post;
    $post_type = get_post_type();
    $taxonomies = 'category';
    $arrTaxonomies = get_object_taxonomies(array('post_type' => $post_type), 'objects');
    foreach ($arrTaxonomies as $key => $objTax) {
        if (is_taxonomy_hierarchical($objTax->name)) {
            $taxonomies = $objTax->name;
            break;
        }
    }
    if ($smof_data['detail_detail'] == '1') {
        ob_start();
        ?>
		<div class="cs-blog-info">
            <ul class="unliststyle">
                <?php 
        if ($smof_data['detail_date'] == '1') {
            $archive_date = get_the_date($smof_data['archive_date_format']);
            ?>
            	    <li><a href="<?php 
            echo get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d'));
            ?>
" title="<?php 
            echo __("View all posts date ", THEMENAME) . $archive_date;
            ?>
"><?php 
            echo $archive_date;
            ?>
</a></li>
            	<?php 
        }
        ?>
            	<?php 
        if ($smof_data['detail_author'] == '1') {
            ?>
                    <li><?php 
            _e('Posted by ', THEMENAME);
            the_author_posts_link();
            ?>
</li>
                <?php 
        }
        ?>
            	<?php 
        if ($smof_data['detail_category'] == '1') {
            $categories = get_the_terms(0, $taxonomies);
            $separator = ', ';
            $output = '';
            ?>
                	<?php 
            if (!empty($categories)) {
                ?>
            	    <li>
            		<?php 
                foreach ($categories as $category) {
                    if (is_object($category)) {
                        $output .= '<a href="' . get_term_link($category->term_id, $taxonomies) . '" title="' . esc_attr(sprintf(__("View all posts in %s", THEMENAME), $category->name)) . '">' . $category->name . '</a>' . $separator;
                    }
                }
                echo trim($output, $separator);
                ?>
            	    </li>
            	    <?php 
            }
            ?>
            	<?php 
        }
        ?>
            	<?php 
        if ($smof_data['detail_tags']) {
            $tags = get_the_tags($post->ID);
            $separator = ', ';
            $output = '';
            ?>
            	   <?php 
            if (!empty($tags)) {
                ?>
            	   <li>
                   <?php 
                foreach ($tags as $tag) {
                    if (is_object($tag)) {
                        $output .= '<a href="' . get_tag_link($tag->term_id) . '" title="' . esc_attr(sprintf(__("View all posts in tag %s", THEMENAME), $tag->name)) . '">' . $tag->name . '</a>' . $separator;
                    }
                }
                echo trim($output, $separator);
                ?>
            	   </li>
            	   <?php 
            }
            ?>
            	<?php 
        }
        ?>
            	<?php 
        if ($smof_data['detail_comments'] == '1') {
            ?>
            	<li><a href="<?php 
            echo get_the_permalink();
            ?>
" title="<?php 
            _e('View all Comments', THEMENAME);
            ?>
"><?php 
            comments_number(__('0 Comments', THEMENAME), __('1 Comments', THEMENAME), __('% Comments', THEMENAME));
            ?>
</a></li>
            	<?php 
        }
        ?>
            	<?php 
        if ($smof_data['detail_like'] == '1') {
            ?>
            	<li><?php 
            post_favorite();
            ?>
</li>
            	<?php 
        }
        ?>
            	<?php 
        if ($smof_data['detail_social'] == '1') {
            ?>
            	<li><?php 
            cshero_social_sharing_render('', true, false);
            ?>
</li>
            	<?php 
        }
        ?>
            	<?php 
        if (get_post_format() == 'link' && get_post_meta($post->ID, 'cs_post_link', true)) {
            ?>
    			<li class="cs-blog-link">
    			    <a href="<?php 
            echo get_post_meta(get_the_ID(), 'cs_post_link', true);
            ?>
"><?php 
            if (get_post_meta(get_the_ID(), 'cs_post_link_text', true)) {
                echo get_post_meta(get_the_ID(), 'cs_post_link_text', true);
            } else {
                echo get_post_meta(get_the_ID(), 'cs_post_link', true);
            }
            ?>
</a>
    			</li>
    			<?php 
        }
        ?>
        	</ul>
		</div>
		<?php 
        return ob_get_clean();
    }
}