Exemplo n.º 1
0
    public function widget($args, $instance)
    {
        global $post, $chairman_opt;
        $title = apply_filters('widget_title', $instance['title']);
        // before and after widget arguments are defined by themes
        echo wp_kses($args['before_widget'], array('aside' => array('id' => array(), 'class' => array())));
        if (!empty($title)) {
            echo wp_kses($args['before_title'] . $title . $args['after_title'], array('aside' => array('id' => array(), 'class' => array()), 'h3' => array('class' => array()), 'span' => array('class' => array())));
        }
        switch ($instance['type']) {
            case 'recent_posts':
                $postargs = array('posts_per_page' => $instance['amount'], 'order' => 'DESC', 'orderby' => 'post_date');
                $postslist = get_posts($postargs);
                $thumbsize = explode(',', $instance['size']);
                $thumbsize[0] = (int) $thumbsize[0];
                $thumbsize[1] = (int) $thumbsize[1];
                ?>
				<div class="recent-posts">
					<ul>
						<?php 
                foreach ($postslist as $post) {
                    setup_postdata($post);
                    ?>
 
							<li>
								<div class="post-wrapper">
									<div class="post-thumb">
										<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_post_thumbnail($thumbsize);
                    ?>
</a>
									</div>
									<div class="post-info">
										<h3 class="post-title"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h3>
										<div class="post-date">
											<?php 
                    echo get_the_date();
                    ?>
										</div>
									</div>
								</div>
							</li>
						<?php 
                }
                ?>
					</ul>
				</div>
				<?php 
                wp_reset_postdata();
                break;
            case 'popular_posts':
                $postargs = array('posts_per_page' => $instance['amount'], 'order' => 'DESC', 'orderby' => 'comment_count');
                $postslist = get_posts($postargs);
                $thumbsize = explode(',', $instance['size']);
                $thumbsize[0] = (int) $thumbsize[0];
                $thumbsize[1] = (int) $thumbsize[1];
                ?>
				<div class="recent-posts">
					<ul>
						<?php 
                foreach ($postslist as $post) {
                    setup_postdata($post);
                    ?>
 
							<li>
								<div class="post-wrapper">
									<div class="post-thumb">
										<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_post_thumbnail($thumbsize);
                    ?>
</a>
									</div>
									<div class="post-info">
										<h3 class="post-title"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h3>
										<div class="post-date">
											<?php 
                    echo get_the_date();
                    ?>
										</div>
									</div>
								</div>
							</li>
						<?php 
                }
                ?>
					</ul>
				</div>
				<?php 
                wp_reset_postdata();
                break;
            case 'recent_comments':
                $commentargs = array('status' => 'approve', 'post_type' => 'post', 'number' => $instance['amount']);
                $comments = get_comments($commentargs);
                ?>
				<ul>
					<?php 
                foreach ($comments as $comment) {
                    ?>
					<li>
						<div class="post-wrapper">
							<div class="post-thumb">
								<?php 
                    echo get_avatar($comment->comment_author_email, 50, '', '');
                    ?>
							</div>
							<div class="post-info">
								<p><?php 
                    echo esc_html($comment->comment_author);
                    ?>
 <?php 
                    esc_html_e('says', 'chairman');
                    ?>
:</p>
								<a href="<?php 
                    echo get_comments_link($comment->comment_post_ID);
                    ?>
" title="<?php 
                    echo esc_attr($comment->comment_author) . ' on ' . get_the_title($comment->comment_post_ID);
                    ?>
"><?php 
                    echo Chairman::chairman_limitStringByWord($comment->comment_content, 30, '...');
                    ?>
</a>
							</div>
						</div>
					</li>
					<?php 
                }
                ?>
				</ul>	
				<?php 
                break;
        }
        echo wp_kses($args['after_widget'], array('aside' => array('id' => array(), 'class' => array()), 'h3' => array('class' => array()), 'span' => array('class' => array())));
    }
Exemplo n.º 2
0
 */
$chairman_opt = get_option('chairman_opt');
get_header();
?>
<div class="main-container about-page">
	<div class="title-breadcrumb">
		<div class="container">
			<div class="title-breadcrumb-inner">
				<header class="entry-header">
					<h1 class="entry-title"><?php 
the_title();
?>
</h1>
				</header>
				<?php 
Chairman::chairman_breadcrumb();
?>
			</div>
		</div>
	</div>
	<div class="page-content">
		<div class="about-container">
			<?php 
while (have_posts()) {
    the_post();
    ?>
				<?php 
    get_template_part('content', 'page');
    ?>
			<?php 
}
Exemplo n.º 3
0
        ?>
</div>
					<?php 
    }
    ?>
				</div>
			<?php 
}
?>
			
			<?php 
if (is_single()) {
    ?>
				<div class="entry-meta">
					<?php 
    Chairman::chairman_entry_meta();
    ?>
				</div>
			
				<?php 
    if (function_exists('chairman_blog_sharing')) {
        ?>
					<div class="social-sharing"><?php 
        chairman_blog_sharing();
        ?>
</div>
				<?php 
    }
    ?>
			
				<div class="author-info">
Exemplo n.º 4
0
						<?php 
    /* Start the Loop */
    while (have_posts()) {
        the_post();
        /*
         * Include the post format-specific template for the content. If you want to
         * this in a child theme then include a file called called content-___.php
         * (where ___ is the post format) and that will be used instead.
         */
        get_template_part('content', get_post_format());
    }
    ?>
						
						<div class="pagination">
							<?php 
    Chairman::chairman_pagination();
    ?>
						</div>
						
					<?php 
} else {
    ?>
						<?php 
    get_template_part('content', 'none');
    ?>
					<?php 
}
?>
				</div>
			</div>
			<?php 
Exemplo n.º 5
0
 * as little as possible, but it does happen. When this occurs the version of the template file will.
 * be bumped and the readme will list any important changes.
 *
 * @see     http://docs.woothemes.com/document/template-structure/
 * @author  WooThemes
 * @package WooCommerce/Templates
 * @version 2.5.0
 */
if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
global $product, $woocommerce_loop;
$chairman_opt = get_option('chairman_opt');
$chairman_viewmode = Chairman::chairman_show_view_mode();
$chairman_productsfound = Chairman::chairman_shortcode_products_count();
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
    $woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
    $woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Ensure visibility
if (!$product || !$product->is_visible()) {
    return;
}
// Increase loop count
$woocommerce_loop['loop']++;
// Extra post classes
// Ensure visibility
if (!$product || !$product->is_visible()) {
    return;
}
// Increase loop count
$woocommerce_loop['loop']++;
// Extra post classes
$classes = array();
if (0 == ($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns']) {
    $classes[] = 'first';
}
if (0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns']) {
    $classes[] = 'last';
}
$count = $product->get_rating_count();
$chairman_shopclass = Chairman::chairman_shop_class('');
if ($chairman_shopclass == 'shop-fullwidth') {
    if (isset($chairman_opt)) {
        $woocommerce_loop['columns'] = $chairman_opt['product_per_row_fw'];
        $colwidth = round(12 / $woocommerce_loop['columns']);
    }
    $classes[] = ' item-col col-xs-12 col-sm-4 col-md-' . $colwidth;
} else {
    if (isset($chairman_opt)) {
        $woocommerce_loop['columns'] = $chairman_opt['product_per_row'];
        $colwidth = round(12 / $woocommerce_loop['columns']);
    }
    $classes[] = ' item-col col-xs-12 col-sm-' . $colwidth;
}
?>
Exemplo n.º 7
0
if (isset($_GET['sidebar']) && $_GET['sidebar'] != '') {
    $shopsidebar = $_GET['sidebar'];
}
switch ($shoplayout) {
    case 'fullwidth':
        Chairman::chairman_shop_class('shop-fullwidth');
        $shopcolclass = 12;
        $shopsidebar = 'none';
        $productcols = 4;
        break;
    default:
        Chairman::chairman_shop_class('shop-sidebar');
        $shopcolclass = 9;
        $productcols = 3;
}
$chairman_viewmode = Chairman::chairman_show_view_mode();
?>
<div class="main-container">
	<div class="page-content"> 
		<div class="shop-desc <?php 
echo esc_attr($shoplayout);
?>
">
			<div class="shop_header">
				<div class="container">
					<div class="shop-desc-inner">
						<?php 
if (apply_filters('woocommerce_show_page_title', true)) {
    ?>
							<header class="entry-header">
								<h1 class="entry-title"><?php