get_option( 'post_date') === 'on') || ($post_list && $bicycleshop_a13->get_option( 'blog_date') === 'on') ){ $return .= bicycleshop_posted_on(); } //return updated date if( ($post && $bicycleshop_a13->get_option( 'post_date') === 'updated') || ($post_list && $bicycleshop_a13->get_option( 'blog_date') === 'updated') ){ $return .= esc_html__( 'Updated: ', 'bicycleshop' ).bicycleshop_modified_on(); } //return author if( $page ){ //no author for page post type $return = ''; } elseif( ($post && $bicycleshop_a13->get_option( 'post_author') === 'on') || ($post_list && $bicycleshop_a13->get_option( 'blog_author') === 'on') ){ $return .= bicycleshop_posted_by_author(); } //return comments number if( ($post && $bicycleshop_a13->get_option( 'post_comments') === 'on') || ($post_list && $bicycleshop_a13->get_option( 'blog_comments') === 'on') ){ $return .= bicycleshop_post_comments(); } //Categories if( ($post && $bicycleshop_a13->get_option( 'post_cats') === 'on') || ($post_list && $bicycleshop_a13->get_option( 'blog_cats') === 'on') ){ $categories = get_the_category_list(', '); if(strlen($categories)){ //if there is already any content if(strlen($return)){ $return .= ''; } $return .= '
'; } } if(strlen($return)){ return ' '; } return ''; } } if(!function_exists( 'bicycleshop_post_meta_data' )){ /** * Outputs post meta data like date, author, comments number and categories * * @since 2.3.0 */ function bicycleshop_post_meta_data() { echo bicycleshop_get_post_meta_data(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } if(!function_exists('bicycleshop_posted_on')){ /** * get HTML for date of post * @return string */ function bicycleshop_posted_on() { return ' '; } } if(!function_exists('bicycleshop_modified_on')){ /** * get HTML for date of post * @return string */ function bicycleshop_modified_on() { return ' '; } } if(!function_exists('bicycleshop_posted_by_author')){ /** * Author of post * @return string */ function bicycleshop_posted_by_author() { /** @noinspection HtmlUnknownAttribute */ return /* translators: %s - author name */ sprintf( esc_html__( 'by %s ', 'bicycleshop' ), sprintf('%3$s', esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) )), /* translators: %s - author name */ sprintf( esc_attr__( 'View all posts by %s', 'bicycleshop' ), get_the_author() ), get_the_author(), bicycleshop_get_schema_args('author'), bicycleshop_get_schema_args('name') ) ).' ';//additional space in case someone removed it during translation } } if(!function_exists('bicycleshop_post_comments')){ /** * comments link * * @return string HTML */ function bicycleshop_post_comments() { $comment_number = get_comments_number(); /** @noinspection HtmlUnknownAttribute */ $schema = ' '; return ' ' .$comment_number. ''.$schema; } } if(!function_exists('bicycleshop_under_post_content')){ function bicycleshop_under_post_content() { global $bicycleshop_a13; $types = bicycleshop_what_page_type_is_it(); $post = $types['post']; $post_list = $types['blog_type']; //when call was made for something else then post or blog, then lets treat it as blog //it will enable showing this module in Visual Composer in Post grid if(!$post && !$post_list){ $post_list = true; } //links to other subpages wp_link_pages( array( 'before' => ''.esc_html__( 'Read more', 'bicycleshop' ).'
'; } } add_filter( 'excerpt_more', 'bicycleshop_new_excerpt_more' ); if(!function_exists('bicycleshop_has_excerpt_read_more')){ /** * Adds read more when excerpt is provided by user * * @return string HTML */ function bicycleshop_has_excerpt_read_more($content) { global $post, $bicycleshop_a13; if( $bicycleshop_a13->get_option( 'blog_read_more', 'on' ) === 'on' && has_excerpt() ){ $content .= ''.esc_html__( 'Read more', 'bicycleshop' ).'
'; } return $content; } } add_filter( 'the_excerpt', 'bicycleshop_has_excerpt_read_more' ); if(!function_exists('bicycleshop_read_more_new_line')){ /** * Wraps read more in new paragraph so it will land in new line * * @param string $link current link in HTML * * @return string HTML */ function bicycleshop_read_more_new_line($link) { return ''.$link.'
'; } } add_filter( 'the_content_more_link', 'bicycleshop_read_more_new_line' ); if(!function_exists('bicycleshop_comments_navigation')){ /** * Comments navigation */ function bicycleshop_comments_navigation() { if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> \n"; $split = preg_split("/(\r?\n)+|($who: $what
\n"; } else { $chatoutput .= $haystack . "\n"; } } // print our new formated chat post $content = $chatoutput . "\n"; return $content; } } if(!function_exists('bicycleshop_display_items_from_query_post_list')) { /** * @param bool|WP_Query $query * @param array $args */ function bicycleshop_display_items_from_query_post_list($query = false, $args = array()){ global $bicycleshop_a13; static $id = 0; $id++; if($query === false){ global $wp_query; $query = $wp_query; } $default_args = array( 'columns' => $bicycleshop_a13->get_option( 'blog_brick_columns' ), 'max_width' => $bicycleshop_a13->get_option( 'blog_bricks_max_width' ), 'margin' => $bicycleshop_a13->get_option( 'blog_brick_margin' ), 'filter' => false, 'default_filter' => '__all', 'all_filter' => true, 'display_post_id' => true, ); $args = wp_parse_args($args, $default_args); /* show filter? */ if($args['filter']){ $query_args = array( 'hide_empty' => true, 'object_ids' => wp_list_pluck( $query->posts, 'ID' ), 'taxonomy' => 'category' ); /** @noinspection PhpInternalEntityUsedInspection */ $terms = get_terms( $query_args ); bicycleshop_make_post_grid_filter($terms, 'posts-filter', $args['default_filter'], $args['all_filter']); } /* If there are no posts to display, such as an empty archive page */ if ( ! $query->have_posts() ): ?>