theme_options = deep_free_options(); $this->get_header(); $this->set_variables(); $this->content(); $this->get_footer(); } /** * Get header template. * * @since 1.0.0 */ public function get_header() { get_header(); } /** * Get footer template. * * @since 1.0.0 */ public function get_footer() { get_footer(); } /** * Set global variables * * @since 1.0.0 */ public function set_variables() { $this->post_count = '0'; $this->sidebar = deep_free_get_option( $this->theme_options, 'deep_blog_sidebar', 'right' ); $this->template = deep_free_get_option( $this->theme_options, 'deep_blog_template', '2' ); $this->page_title = deep_free_get_option( $this->theme_options, 'deep_blog_page_title', 'Blog' ); $this->blog_sidebar = deep_free_get_option( $this->theme_options, 'deep_sidebar_blog_options' ); $this->template_layout = deep_free_get_option( $this->theme_options, 'deep_blog_template_layout', '2' ); $this->enable_page_title = deep_free_get_option( $this->theme_options, 'deep_blog_page_title_enable', '1' ); $this->enable_post_title = deep_free_get_option( $this->theme_options, 'deep_blog_posttitle_enable', '1' ); $this->enable_comments_meta = deep_free_get_option( $this->theme_options, 'deep_blog_meta_comments_enable', '1' ); $this->enable_category_meta = deep_free_get_option( $this->theme_options, 'deep_blog_meta_category_enable', '1' ); $this->enable_featured_image = deep_free_get_option( $this->theme_options, 'deep_blog_featuredimage_enable', '1' ); } /** * Render content. * * @since 1.0.0 */ public function content() { // disable sidebar in masonry and timeline if ( $this->template_layout == '6' || $this->template_layout == '7' ) { $this->sidebar = 'none'; } $this->headline(); $this->before_posts(); if ( have_posts() ) : $this->jetpack_integration(); while( have_posts() ) : the_post(); switch ($this->template) { // Default case '1': if ( $this->template_layout == '1' ) { $this->default_standard(); } elseif ( $this->template_layout == '2' ) { $this->default_list(); } elseif ( $this->template_layout == '3' ) { $this->default_standard_then_list(); } elseif ( $this->template_layout == '4' ) { $this->default_grid(); } elseif ( $this->template_layout == '5' ) { $this->default_standard_then_grid(); } break; // Personal Blog case '2': if ( $this->template_layout == '1' ) { $this->personal_blog_standard(); } elseif ( $this->template_layout == '2' ) { $this->personal_blog_list(); } elseif ( $this->template_layout == '3' ) { $this->personal_blog_standard_then_list(); } elseif ( $this->template_layout == '4' ) { $this->personal_blog_grid(); } elseif ( $this->template_layout == '5' ) { $this->personal_blog_standard_then_grid(); } break; // Magazine case '3': if ( $this->template_layout == '1' ) { $this->magazine_standard(); } elseif ( $this->template_layout == '2' ) { $this->magazine_list(); } elseif ( $this->template_layout == '3' ) { $this->magazine_standard_then_list(); } elseif ( $this->template_layout == '4' ) { $this->magazine_grid(); } elseif ( $this->template_layout == '5' ) { $this->magazine_standard_then_grid(); } break; } // template layout = masonry if ( $this->template_layout == '6' ) { $this->masonry(); // template layout = timeline } elseif ( $this->template_layout == '7' ) { $this->timeline(); } endwhile; wp_reset_postdata(); else: get_template_part('blogloop-none'); endif; $this->after_posts(); } /** * Headline. * * @since 1.0.0 */ public function headline() { if ( $this->enable_page_title ) { if ( is_archive() ) { echo '

'; if ( is_day() ) : printf( '' . esc_html__( 'Daily Archives', 'deep-free' ) . ': %s', get_the_date() ); elseif ( is_month() ) : printf( '' . esc_html__( 'Monthly Archives', 'deep-free' ) . ': %s', get_the_date( _x( 'F Y', 'monthly archives date format', 'deep-free' ) ) ); elseif ( is_year() ) : printf( '' . esc_html__( 'Yearly Archives', 'deep-free' ) . ': %s', get_the_date( _x( 'Y', 'yearly archives date format', 'deep-free' ) ) ); elseif ( is_category() ): printf( '%s', single_cat_title( '', false ) ); elseif ( is_tag() ): printf( '' . esc_html__( 'Tag', 'deep-free' ) . ': %s', single_tag_title( '', false ) ); else : echo esc_html( $this->blog_title ); endif; echo '

'; } else { echo'

'. esc_html( $this->page_title ) .'

'; } } } /** * Before start posts * * @since 1.0.0 */ private function before_posts() { // if: template layout isn't masonry or timeline if( $this->template_layout == '1' || $this->template_layout == '2' || $this->template_layout == '3' || $this->template_layout == '4' || $this->template_layout == '5' || $this->template_layout == '8' || $this->template_layout == '9' || $this->template_layout == '10' ) { echo '

'; // left sidebar if ( $this->sidebar == 'left' || $this->sidebar == 'both' ) { echo ''; } if ( $this->sidebar == 'both' ) { $class='col-md-6 cntt-w'; } elseif ( $this->sidebar == 'right' || $this->sidebar == 'left' ) { $class='col-md-9 cntt-w'; } else { $class='col-md-12 omega'; } $infinite_id = ''; if ( class_exists( 'Jetpack' ) && get_option( 'infinite_scroll' ) == '1' ): $infinite_id = 'wn-infinite-jetpack'; endif; echo '
'; // templatelayout: masonry } else if ($this->template_layout == '6') { echo'
'; // templatelayout: timeline } else if ($this->template_layout == '7') { echo'
'; } // template_layout = standard then grid if ( $this->template_layout == '3' ) { echo '
'; } } /** * Jetpack integration * * @since 1.0.0 */ private function jetpack_integration() { if ( class_exists( 'Jetpack' ) ) : if ( deep_has_featured_posts( 1 ) ) : echo ''; $this->post_count ++; endif; endif; } /** * Default template, Standard posts layout * * @since 1.0.0 */ private function default_standard() { echo '
'; get_template_part('parts/blogloop'); echo '
'; } /** * Default template, List posts layout * * @since 1.0.0 */ private function default_list() { echo '
'; get_template_part('parts/blogloop','type2'); echo '
'; } /** * Default template, Standard then List posts layout * * @since 1.0.0 */ private function default_standard_then_list() { if ( $this->post_count == '0' ) { echo '
'; get_template_part('parts/blogloop'); echo '
'; } else { echo '
'; get_template_part('parts/blogloop','type2'); echo '
'; } $this->post_count ++; } /** * Default template, Grid posts layout * * @since 1.0.0 */ private function default_grid() { get_template_part( 'parts/blogloop', 'type3' ); } /** * Default template, Standard then Grid posts layout * * @since 1.0.0 */ private function default_standard_then_grid() { if ( $this->post_count == '0' ) { echo '
'; get_template_part('parts/blogloop'); echo '
'; echo '
'; } else { get_template_part('parts/blogloop','type3'); } $this->post_count++; } /** * Personal Blog template, Standard posts layout * * @since 1.0.0 */ private function personal_blog_standard() { echo '
'; get_template_part('parts/blogloop','type1'); echo '
'; } /** * Personal Blog template, List posts layout * * @since 1.0.0 */ private function personal_blog_list() { echo '
'; get_template_part('parts/blogloop','type5'); echo '
'; } /** * Personal Blog template, Standard then List posts layout * * @since 1.0.0 */ private function personal_blog_standard_then_list() { if( $this->post_count == '0' ) { echo '
'; get_template_part('parts/blogloop','type1'); echo '
'; } else { echo '
'; get_template_part('parts/blogloop','type5'); echo '
'; } $this->post_count++; } /** * Personal Blog template, Grid posts layout * * @since 1.0.0 */ private function personal_blog_grid() { echo '
'; get_template_part('parts/blogloop','type7'); echo '
'; } /** * Personal Blog template, Standard then Grid posts layout * * @since 1.0.0 */ private function personal_blog_standard_then_grid() { $classes = $this->post_count == '0' ? 'blgtyp10 blg-personal-full' : 'col-md-6 blg-typ3 blgtyp10 blg-personal-grid'; if ( $this->post_count == '0' ) { echo '
'; get_template_part( 'parts/blogloop', 'type1' ); echo '
'; } else { echo '
'; get_template_part( 'parts/blogloop', 'type7' ); echo '
'; } $this->post_count++; } /** * Magazine template, Standard posts layout * * @since 1.0.0 */ private function magazine_standard() { echo '
'; if( $this->post_count == '0' ) { get_template_part('parts/blogloop','type6'); } echo '
'; } /** * Magazine template, List posts layout * * @since 1.0.0 */ private function magazine_list() { echo '
'; get_template_part('parts/blogloop','type4'); echo '
'; } /** * Magazine template, Standard then List posts layout * * @since 1.0.0 */ private function magazine_standard_then_list() { if( $this->post_count == '0' ) { echo '
'; get_template_part('parts/blogloop','type6'); echo '
'; } else { echo '
'; get_template_part('parts/blogloop','type4'); echo '
'; } $this->post_count++; } /** * Magazine template, Grid posts layout * * @since 1.0.0 */ private function magazine_grid() { if ( $this->post_count % 2 == 0 ) { echo '
'; } echo '
'; echo '
'; get_template_part('parts/blogloop','type8'); echo '
'; echo '
'; if ( $this->post_count % 2 == 1 ) { echo '
'; } $this->post_count++; } /** * Magazine template, Standard then Grid posts layout * * @since 1.0.0 */ private function magazine_standard_then_grid() { $classes = $this->post_count == '0' ? 'blgtyp11 blg-magazine-full' : ' blg-magazine-grid col-md-6 blg-typ3 blgtyp11'; echo '
'; if( $this->post_count == '0' ) { get_template_part('parts/blogloop','type6'); } else { get_template_part('parts/blogloop','type8'); } $this->post_count++; echo '
'; } /** * Masonry posts layout * * @since 1.0.0 */ private function masonry() { get_template_part( 'parts/blogloop','masonry' ); } /** * Timline posts layout * * @since 1.0.0 */ private function timeline() { global $post; $timeline_last_time = get_the_time(get_option( 'date_format' )); $timeline_i = 1; $timeline_flag = false; $post_id = $post->ID; $post_format = get_post_format( $post_id ); $content = get_the_content(); if ( ! $post_format ) { $post_format = 'standard'; } if ( ( $timeline_last_time != date( ' F Y', strtotime( $post->post_date ) ) ) || $timeline_i == 1 ) { $timeline_last_time = date(' F Y', strtotime( $post->post_date ) ); echo '
'. wp_kses( date( ' F Y', strtotime( $post->post_date ) ), wp_kses_allowed_html( 'post' ) ) .'
'; if ( $timeline_i > 1 ) { $timeline_flag = true; } } ?>
enable_category_meta ): ?>
enable_post_title ) { if ( ( 'aside' != $post_format ) && ('quote' != $post_format ) ) { if ( 'link' == $post_format ) { preg_match( '/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i', $content, $matches ); $content = preg_replace( '/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i','', $content, 1 ); $link =''; if ( isset( $matches ) && is_array( $matches ) ) { $link = $matches[0]; } ?>

'; echo wp_kses( deep_excerpt(31), wp_kses_allowed_html( 'post' ) ); echo ''; } ?>
enable_featured_image ) { $meta_video = rwmb_meta( 'deep_featured_video_meta' ); if ( $post_format == 'video' || $post_format == 'audio' ) { $pattern = '\\[' . '(\\[?)' . "(video|audio)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; preg_match( '/' . $pattern . '/s', $post->post_content, $matches ); if ( ( is_array( $matches) ) && ( isset( $matches[3] ) ) && ( ( $matches[2] == 'video' ) || ( 'audio' == $post_format ) ) && ( isset($matches[2] ) ) ) { $video = $matches[0]; echo do_shortcode($video); $content = preg_replace('/'.$pattern.'/s', '', $content); } elseif ( (! empty( $meta_video )) ) { echo do_shortcode($meta_video); } } else { if( 'gallery' == $post_format){ $pattern = '\\[' . '(\\[?)' . "(gallery)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; preg_match( '/' . $pattern . '/s', $post->post_content, $matches ); if ( ( is_array( $matches ) ) && ( isset($matches[3])) && ( $matches[2] == 'gallery' ) && ( isset( $matches[2] ) ) ) { $ids = ( shortcode_parse_atts( $matches[3] ) ); if ( is_array( $ids ) && isset( $ids['ids'] ) ) { $ids = $ids['ids']; } echo wp_kses( get_post_gallery(), wp_kses_allowed_html( 'post' ) ); $content = preg_replace('/'.$pattern.'/s', '', $content); } } else { if ( $thumbnail_url ) { ?> <?php the_title(); ?>
template_layout == '7' ) { echo'
'. wp_kses( get_the_time(get_option( 'date_format' )), wp_kses_allowed_html( 'post' ) ) .'
'; } if ( $this->template_layout == '3' || $this->template_layout == '6' || $this->template_layout == '7' ) { echo '
'; } if ( class_exists( 'Jetpack' ) && get_option( 'infinite_scroll' ) == '1' ) { //return; } else { if ( function_exists( 'wp_pagenavi' ) ) { if ( ( $this->template == '3' && $this->template_layout == '1' ) || ( $this->template == '3' && $this->template_layout == '2' ) || ( $this->template == '3' && $this->template_layout == '3' ) || ( $this->template == '3' && $this->template_layout == '4' ) || ( $this->template == '3' && $this->template_layout == '5' ) ) { echo '
'; } wp_pagenavi(); if ( ( $this->template == '3' && $this->template_layout == '1' ) || ( $this->template == '3' && $this->template_layout == '2' ) || ( $this->template == '3' && $this->template_layout == '3' ) || ( $this->template == '3' && $this->template_layout == '4' ) || ( $this->template == '3' && $this->template_layout == '5' ) ) { echo '
'; } } else { echo '
'; next_posts_link(esc_html__('← Previous page', 'deep-free')); previous_posts_link(esc_html__('Next page →', 'deep-free')); echo '
'; } } ?>
template_layout == '1' || $this->template_layout == '2' || $this->template_layout == '3' || $this->template_layout == '4' || $this->template_layout == '5' ) { ?>
sidebar == 'right' || $this->sidebar == 'both' ) { echo ''; } if ( $this->template_layout == '1' || $this->template_layout == '2' || $this->template_layout == '3' || $this->template_layout == '4' || $this->template_layout == '5' || $this->template_layout == '6' ) { echo '
'; } } } // Run WN_Index::get_instance(); }