Example #1
0
    public function widget($args, $instance)
    {
        if (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }
        $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
        $number = !empty($instance['number']) ? absint($instance['number']) : 5;
        if (!$number) {
            $number = 5;
        }
        $args_article = array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'order' => $instance['order'], 'orderby' => $instance['orderby']);
        if (is_array($instance['category'])) {
            $args_article['category__in'] = $instance['category'];
        }
        $r = new WP_Query(apply_filters('widget_posts_args', $args_article));
        if ($r->have_posts()) {
            echo $args['before_widget'];
            if ($title) {
                echo $args['before_title'] . $title . $args['after_title'];
            }
            ob_start();
            $carousel_html = '';
            ?>
            <?php 
            while ($r->have_posts()) {
                $r->the_post();
                ?>
                <div <?php 
                post_class();
                ?>
>
                    <?php 
                cruxstore_post_thumbnail_image('cruxstore_square', 'img-responsive', false);
                ?>
                    <div class="post-carousel-content">
                        <?php 
                cruxstore_post_meta_categories();
                ?>
                        <h4><?php 
                get_the_title() ? the_title() : the_ID();
                ?>
</h4>
                    </div>

                    <a href="<?php 
                the_permalink();
                ?>
" class="post-carousel-link"></a>
                </div>
            <?php 
            }
            ?>
            <?php 
            wp_reset_postdata();
            $carousel_html .= ob_get_clean();
            if ($carousel_html) {
                $atts = array('desktop' => 1, 'tablet' => 1, 'mobile' => 1, 'navigation_always_on' => false, 'navigation_position' => 'center', 'carousel_skin' => 'white', 'gutters' => false);
                $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts), '', 'cruxstore-owl-carousel');
                echo str_replace('%carousel_html%', $carousel_html, $carousel_ouput);
            }
            echo $args['after_widget'];
        }
    }
Example #2
0
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class('blog-post');
?>
 itemscope itemtype="http://schema.org/BlogPosting">
    <div class="blog-post-content">
        <?php 
cruxstore_post_thumbnail_image('cruxstore_grid');
?>
        <div class="blog-post-inner">
            <?php 
the_title(sprintf('<h2 class="entry-title" itemprop="name headline"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h2>');
?>
            <?php 
cruxstore_entry_meta();
?>
            <?php 
cruxstore_entry_excerpt();
?>
            <p class="entry-more">
                <?php 
printf('<a href="%1$s" class="%2$s">%3$s</a>', esc_url(get_permalink(get_the_ID())), 'btn btn-default', sprintf(esc_html__('Read more %s', 'cruxstore'), '<span class="screen-reader-text">' . get_the_title(get_the_ID()) . '</span>'));
?>
            </p>
        </div>
    </div>
</article><!-- #post-## -->
Example #3
0
<div class="article-widget-item">
    <?php 
cruxstore_post_thumbnail_image('cruxstore_widgets', 'img-responsive');
?>
    <div class="content">
        <a class="title-link" href="<?php 
the_permalink();
?>
"><?php 
get_the_title() ? the_title() : the_ID();
?>
</a>
        <div class="post-meta">
            <?php 
cruxstore_post_meta_author();
cruxstore_post_meta_comments();
?>
        </div>
    </div>
</div>
Example #4
0
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class('single-post-wrap');
?>
 itemscope="" itemtype="http://schema.org/BlogPosting">
    <header class="entry-header">
        <?php 
the_title(sprintf('<h1 class="entry-title" itemprop="name headline">', esc_url(get_permalink())), '</h1>');
cruxstore_post_meta();
?>
    </header><!-- .entry-header -->
    <?php 
cruxstore_post_thumbnail_image('full', 'img-responsive', false, false);
?>
    <div class="single-post-content">
        <div class="entry-content clearfix" itemprop="articleBody">
            <?php 
the_content();
?>
            <?php 
if (!post_password_required()) {
    wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . esc_html__('Pages:', 'cruxstore') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '<span class="screen-reader-text">' . esc_html__('Page', 'cruxstore') . ' </span>%', 'separator' => '<span class="screen-reader-text">, </span>'));
}
?>
        </div><!-- .entry-content -->
    </div>
    <footer class="entry-footer">
        <?php 
cruxstore_post_meta_tags();
Example #5
0
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class('blog-post');
?>
 itemscope itemtype="http://schema.org/BlogPosting">
    <div class="blog-post-content">
        <?php 
cruxstore_post_thumbnail_image('cruxstore_masonry');
?>
        <div class="blog-post-inner">
            <?php 
the_title(sprintf('<h2 class="entry-title" itemprop="name headline"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h2>');
?>
            <?php 
cruxstore_entry_meta();
?>
            <?php 
cruxstore_entry_excerpt();
?>
            <p class="entry-more">
                <?php 
printf('<a href="%1$s" class="%2$s">%3$s</a>', esc_url(get_permalink(get_the_ID())), 'btn btn-default', sprintf(esc_html__('Read more %s', 'cruxstore'), '<span class="screen-reader-text">' . get_the_title(get_the_ID()) . '</span>'));
?>
            </p>
        </div>
    </div>
</article><!-- #post-## -->
Example #6
0
<article id="post-<?php 
the_ID();
?>
" <?php 
post_class('blog-post');
?>
 itemscope itemtype="http://schema.org/BlogPosting">
    <div class="blog-post-content">
        <?php 
cruxstore_post_thumbnail_image('cruxstore_classic');
?>
        <div class="blog-post-inner">
            <?php 
the_title(sprintf('<h3 class="entry-title" itemprop="name headline"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h3>');
?>
            <?php 
cruxstore_entry_meta();
?>
            <div class="entry-content" itemprop="articleBody">
                <?php 
/* translators: %s: Name of current post */
the_content(sprintf(wp_kses(__('Continue reading<span class="screen-reader-text"> "%s"</span>', 'cruxstore'), array('span' => array('class' => array()))), get_the_title()));
wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . esc_html__('Pages:', 'cruxstore') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '<span class="screen-reader-text">' . esc_html__('Page', 'cruxstore') . ' </span>%', 'separator' => '<span class="screen-reader-text">, </span>'));
?>
            </div><!-- .entry-content -->
        </div>
    </div>
</article><!-- #post-## -->
Example #7
0
<div class="article-post-item">
    <?php 
cruxstore_post_thumbnail_image('cruxstore_medium', 'img-responsive');
?>
    <div class="content">
        <a class="title-link" href="<?php 
the_permalink();
?>
"><?php 
get_the_title() ? the_title() : the_ID();
?>
</a>
        <div class="post-meta">
            <?php 
cruxstore_post_meta_author();
cruxstore_post_meta_date();
?>
        </div>
        <?php 
cruxstore_entry_excerpt();
?>
    </div>
</div>
Example #8
0
<div class="article-post-item">
    <?php 
cruxstore_post_thumbnail_image('cruxstore_small', 'img-responsive');
?>
    <div class="content">
        <a class="title-link" href="<?php 
the_permalink();
?>
"><?php 
get_the_title() ? the_title() : the_ID();
?>
</a>
        <div class="post-meta">
            <?php 
cruxstore_post_meta_author();
cruxstore_post_meta_date();
?>
        </div>
        <?php 
cruxstore_entry_excerpt();
?>
    </div>
</div>