Пример #1
0
    /**
     * @param $query
     *
     * @since 1.0.0
     */
    private function blog_style_3($query)
    {
        ?>

        <script type="text/javascript">
            jQuery(document).ready(function(){
                if(typeof ZenBlog02 != "undefined")
                    ZenBlog02.init();
            });
        </script>

        <?php 
        if ($this->has_widgets) {
            ?>
            <div class="<?php 
            echo $this->content_class;
            ?>
">
        <?php 
        }
        ?>

        <?php 
        /* The Loop */
        ?>
        <?php 
        if ($query->have_posts()) {
            ?>

            <?php 
            while ($query->have_posts()) {
                $query->the_post();
                ?>

                <?php 
                /* Get the content template */
                get_template_part('lib/templates/blog-style-3/content', get_post_format());
                ?>

            <?php 
            }
            ?>

        <?php 
        } else {
            ?>

            <?php 
            /* Get the none-content template (error) */
            get_template_part('lib/templates/blog-style-3/content', 'none');
            ?>

        <?php 
        }
        ?>
        <?php 
        wp_reset_postdata();
        ?>
        <?php 
        /* End Of The Loop */
        ?>

        <?php 
        if ($this->has_widgets) {
            ?>
        <div class="col-sm-1-5"></div>

        <div class="col-sm-11-5">
        <?php 
        } else {
            ?>
        <div class="col-sm-1"></div>

        <div class="col-sm-11">
        <?php 
        }
        ?>

        <?php 
        global $zen7_data;
        if ($zen7_data['zen_pag_style'] == '2') {
            zen_paging_nav_query($query);
        } else {
            zen_numbers_pagination_query($query);
        }
        ?>

        <div class="clear"></div>

        </div>

        <?php 
        if ($this->has_widgets) {
            ?>
        </div>
        <?php 
        }
        ?>

        <!-- WIDGETS SIDEBAR -->
        <?php 
        if ($this->has_widgets) {
            ?>
            <!-- Widgets Sidebar Container -->
            <div class="col-sm-3">

                <?php 
            get_sidebar('main-sidebar');
            ?>

            </div>
            <!-- End Widgets Sidebar Container -->
        <?php 
        }
        ?>

        <?php 
    }
Пример #2
0
    public function blog_masonry_shortcode($atts)
    {
        $output = $category = $author = $posts_per_page = $type = $orderby = $order = '';
        extract(shortcode_atts(array('type' => '1', 'posts_per_page' => 6, 'category' => '', 'author' => '', 'orderby' => 'date', 'order' => 'DESC'), $atts));
        // Explode all categories and authors ids into arrays
        if ($category == '') {
            $categories = array();
        } else {
            $categories = explode(",", $category);
        }
        if ($author == '') {
            $authors = array();
        } else {
            $authors = explode(",", $author);
        }
        $prefix = 'zen_';
        if (function_exists('rwmb_meta')) {
            $option = rwmb_meta("{$prefix}page_sidebar");
            if ($option == 'none') {
                $this->has_widgets = false;
                $this->content_class = 'posts-masonry row-padding';
            } else {
                $this->has_widgets = true;
                $this->content_class = 'col-sm-9 posts-masonry';
            }
        }
        // Construct the query
        if (get_query_var('paged')) {
            $paged = get_query_var('paged');
        } elseif (get_query_var('page')) {
            $paged = get_query_var('page');
        } else {
            $paged = 1;
        }
        $args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => (int) $posts_per_page, 'orderby' => $orderby, 'order' => $order, 'category__in' => $categories, 'author__in' => $authors);
        $query = new WP_Query($args);
        $this->blog_query = $query;
        ?>

        <div class="<?php 
        echo $this->content_class;
        ?>
">

            <?php 
        /* The Loop */
        ?>
            <?php 
        if ($query->have_posts()) {
            ?>

                <?php 
            while ($query->have_posts()) {
                $query->the_post();
                ?>

                    <?php 
                /* Get the content template */
                get_template_part('lib/templates/blog-masonry/content', get_post_format());
                ?>

                <?php 
            }
            ?>

            <?php 
        } else {
            ?>

                <?php 
            /* Get the none-content template (error) */
            get_template_part('content', 'none');
            ?>

            <?php 
        }
        ?>
            <?php 
        wp_reset_postdata();
        ?>
            <?php 
        /* End Of The Loop */
        ?>

        </div>

        <!-- WIDGETS SIDEBAR -->
        <?php 
        if ($this->has_widgets) {
            ?>
            <!-- Widgets Sidebar Container -->
            <div class="col-sm-3">

                <?php 
            get_sidebar('main-sidebar');
            ?>

            </div>
            <!-- End Widgets Sidebar Container -->
        <?php 
        }
        ?>

        <div class="clear"></div>

        <?php 
        if ($this->has_widgets) {
            ?>
            <div class="col-sm-9">
        <?php 
        } else {
            ?>
            <div>
        <?php 
        }
        ?>

        <?php 
        global $zen7_data;
        if ($zen7_data['zen_pag_style'] == '2') {
            zen_paging_nav_query($query);
        } else {
            zen_numbers_pagination_query($query);
        }
        ?>

        <div class="clear"></div>

        </div>

        <?php 
        return $output;
    }
Пример #3
0
    private function portfolio_style_3()
    {
        $query = $this->portfolio_query;
        ?>

        <script type="text/javascript">
            jQuery(document).ready(function(){
                if(typeof ZenBlog04 != "undefined")
                    ZenBlog04.init();
            });
        </script>

        <?php 
        /* The Loop */
        ?>
        <?php 
        if ($query->have_posts()) {
            ?>

            <?php 
            while ($query->have_posts()) {
                $query->the_post();
                ?>

                <?php 
                /* Get the content template */
                get_template_part('lib/templates/portfolio/content', 'three');
                ?>

            <?php 
            }
            ?>

        <?php 
        } else {
            ?>

            <?php 
            /* Get the none-content template (error) */
            get_template_part('content', 'none');
            ?>

        <?php 
        }
        ?>
        <?php 
        wp_reset_postdata();
        ?>
        <?php 
        /* End Of The Loop */
        ?>



        <div class="portfolio_bottom_nav">
            <?php 
        global $zen7_data;
        if ($zen7_data['zen_pag_style'] == '2') {
            zen_paging_nav_query($query);
        } else {
            zen_numbers_pagination_query($query);
        }
        ?>

            <div class="clear"></div>
        </div>
        <?php 
    }