'; $pagination_style = codeless_get_mod( 'blog_pagination_style', 'numbers' ); if ( $pagination_style == 'infinite_scroll' ) { echo codeless_infinite_scroll( 'infinite_scroll', $the_query ); } elseif ( $pagination_style == 'next_prev' ) { echo codeless_nextprev_pagination('', 4, $the_query); }elseif ( $pagination_style == 'next_prev_ajax' ) { echo codeless_nextprev_ajax_pagination('', 4, $the_query); } elseif ( $pagination_style == 'load_more' ){ echo codeless_infinite_scroll( 'loadmore', $the_query ); }else { codeless_number_pagination($the_query); } echo ''; } /** * Add twitterwidget on allowed media * * @since 1.0.0 */ add_filter( 'media_embedded_in_content_allowed_types', 'codeless_media_embedded_in_content_allowed_types' ); function codeless_media_embedded_in_content_allowed_types($types){ // used for twitter $types[] = 'blockquote'; $types[] = 'script'; return $types; } /** * Return the exact thumbnail size to use for blog post * * @since 1.0.0 */ function codeless_get_post_thumbnail_size(){ $blog = 'codeless_blog_entry'; if( is_single() ){ $blog = 'codeless_blog_post'; } if( codeless_get_mod( 'blog_image_size', 'theme_default' ) != 'theme_default' ) $blog = codeless_get_mod( 'blog_image_size', 'theme_default' ); if( codeless_get_from_element( 'is_related', false ) ) $blog = 'codeless_blog_related'; return $blog; } /** * Generate Post Entry Meta * To use on blog templates. * * @since 1.0.0 */ function codeless_get_post_entry_meta(){ $entry_meta = array(); // Add Author (By) if( codeless_get_mod( 'blog_entry_meta_author', true ) ){ $entry_meta_ = array(); $entry_meta_['id'] = 'cl-entry__meta--author'; $entry_meta_['prepend'] = esc_attr__( 'By', 'aronia' ); $entry_meta_['value'] = codeless_get_entry_meta_author(); $entry_meta[] = $entry_meta_; } // Categories Listing if( codeless_get_mod( 'blog_entry_meta_categories', true ) ){ $entry_meta_ = array(); $entry_meta_['id'] = 'cl-entry__meta--category'; $entry_meta_['prepend'] = esc_attr__( 'In', 'aronia' ); $entry_meta_['value'] = codeless_get_entry_meta_categories(); $entry_meta[] = $entry_meta_; } // Date Posted /*if( codeless_get_mod( 'blog_entry_meta_date', false ) ){ $entry_meta_ = array(); $entry_meta_['id'] = 'cl-entry__meta--date'; $entry_meta_['prepend'] = esc_attr__( '', 'aronia' ); $format = false; if( codeless_get_mod( 'blog_module', 'isotope' ) == 'grid-blocks' && codeless_get_mod( 'blog_grid_block' ) == 'grid-4' ) $format = 'M j, Y'; $entry_meta_['value'] = codeless_get_entry_meta_date($format); $entry_meta[] = $entry_meta_; }*/ return apply_filters('codeless_post_entry_meta', $entry_meta); } /** * Generate Post Entry Meta Author * * @since 1.0.0 */ function codeless_get_entry_meta_author(){ $author_name = get_the_author(); // Sanitize to not show empty author on customize preview partial refresh if( empty( $author_name ) || is_customize_preview() ) $author_name = esc_attr__( 'admin', 'aronia' ); // Get the author name; wrap it in a link. $author = sprintf( /* translators: %s: post author */ __( '%s', 'aronia' ), '' ); return $author; } /** * Generate Post Entry Meta Date * * @since 1.0.0 */ function codeless_get_entry_meta_date( $format = false ){ $time_string = ''; $date = get_the_date(); if( $format !== false ) $date = get_the_date( $format ); $time_string = sprintf( $time_string, get_the_date( DATE_W3C ), $date ); // Wrap the time string in a link, and preface it with 'Posted on'. return sprintf( /* translators: %s: post date */ __( '%s', 'aronia' ), '' . $time_string . '' ); } /** * Generate Post Entry Meta Categories * * @since 1.0.0 */ function codeless_get_entry_meta_categories(){ /* translators: used between list items, there is a space after the comma */ $separate_meta = esc_attr__( ', ', 'aronia' ); // Get Categories for posts. $categories_list = get_the_category_list( $separate_meta ); return sprintf( /* translators: %s: categories list */ __( '%s', 'aronia' ), ''.$categories_list.'' ); } /** * Generate Post Entry Tools * To use on blog templates. * * @since 1.0.0 */ function codeless_get_post_entry_tools(){ $entry_tools = array(); // Add Comments Count if( codeless_get_mod( 'blog_entry_tools_comments_count', true ) ){ $entry_tool_ = array(); $entry_tool_['id'] = 'cl-entry__tool--comments'; $entry_tool_['html'] = codeless_get_entry_tool_comments_count(); $entry_tools[] = $entry_tool_; } // Add Likes if( codeless_get_mod( 'blog_entry_tools_likes', false ) ){ $entry_tool_ = array(); $entry_tool_['id'] = 'cl-entry__tool--likes'; $entry_tool_['html'] = codeless_get_entry_tool_likes(); $entry_tools[] = $entry_tool_; } // Add Share if( codeless_get_mod( 'blog_entry_tools_share', false ) ){ $entry_tool_ = array(); $entry_tool_['id'] = 'cl-entry__tool--share'; $entry_tool_['html'] = codeless_get_entry_tool_share(); $entry_tools[] = $entry_tool_; } return apply_filters( 'codeless_post_entry_tools', $entry_tools ); } /** * Generate blog entry comments_count * * @since 1.0.0 */ function codeless_get_entry_tool_comments_count(){ ob_start(); comments_number('0', '1', '%'); $output = '' . ob_get_contents() . ''; ob_get_clean(); return $output; } /** * Generate blog entry like button * * @since 1.0.0 */ function codeless_get_entry_tool_likes(){ $output = ''; if( class_exists('Codeless_Post_Like') ) $output = Codeless_Post_Like::like(); return $output; } /** * Generate single blog footer Content * * @since 1.0.0 */ function codeless_single_blog_footer(){ /** * Load Related Blog Items if it's active */ if( codeless_get_mod( 'single_blog_tags', true ) && codeless_single_blog_tags() != '' ) get_template_part( 'template-parts/blog/parts/single', 'tags' ); /** * Single Blog Author Box */ if( codeless_get_mod( 'single_blog_author_box', false ) ) get_template_part( 'template-parts/blog/parts/single', 'author' ); /** * Load Related Blog Items if it's active */ if( codeless_get_mod( 'single_blog_related', false ) ) get_template_part( 'template-parts/blog/parts/single', 'related' ); } /** * Generate single blog post tags list * * @since 1.0.0 */ function codeless_single_blog_tags(){ $tags = get_the_tag_list( '', '' ); return $tags; } /** * Options to pass at Swiper Initialization * Only for Slider Post * * @since 1.0.0 */ function codeless_get_post_slider_options(){ $data = array( 'effect' => codeless_get_mod( 'blog_slider_effect', 'scroll' ), 'lazyLoading' => (bool) codeless_get_mod( 'blog_slider_lazyload', 0 ), 'autoplay' => (codeless_get_mod( 'blog_slider_speed', '' ) == 0 ? '' : codeless_get_mod( 'blog_slider_speed', 0 ) ), 'loop' => (bool) codeless_get_mod( 'blog_slider_loop', 0 ) ); if( codeless_get_mod( 'blog_slider_lazyload', false ) ) $data['preloadImages'] = false; if( codeless_get_mod( 'blog_slider_pagination', true ) ){ $data['pagination'] = '.swiper-pagination'; $data['paginationClickable'] = true; } if( codeless_get_mod( 'blog_slider_nav', true ) ){ $data['nextButton'] = '.swiper-button-next'; $data['prevButton'] = '.swiper-button-prev'; } return apply_filters( 'codeless_post_slider_options', $data ); } function codeless_entry_overlay_icon( $custom = '' ){ $icon = codeless_get_mod( 'blog_entry_overlay_icon', 'arrow-right' ); if( $custom != '' ) $icon = $custom; return 'cl-icon-' . apply_filters( 'codeless_entry_overlay_icon', $icon ); } /** * Generate Overlay for blog entries * * @since 1.0.0 */ function codeless_blog_overlay(){ ?>
'; if( codeless_loop_counter() == 2 ) echo '