' . get_the_title() . '' ) ); $more = sprintf( '', esc_url( get_permalink() ), get_the_ID(), $text ); return $more; } add_filter( 'the_content_more_link', 'amyra_lite_content_more' ); /** * Auto add more links. * * @package Amyra Lite * @since 1.0 */ function amyra_lite_excerpt_more_link( $excerpt ) { $excerpt .= amyra_lite_content_more(); return $excerpt; } add_filter( 'the_excerpt', 'amyra_lite_excerpt_more_link', 21 ); /** * Change the archive title for category page. * * @package Amyra Lite * @since 1.0 */ function amyra_lite_category_title( $title ) { if ( is_category() ) { $title = single_cat_title( '', false ); } return $title; } add_filter( 'get_the_archive_title', 'amyra_lite_category_title' ); /** * Prints HTML with meta information for the current post-date/time and categories, tags.. */ function amyra_lite_posted_on( $meta = array() ) { $default_meta = array( 'post_date' => 1, 'author' => 1, 'category' => 1, 'tag' => 1, 'comment' => 1, ); if( !empty($meta) && is_array($meta) ) { foreach ($default_meta as $meta_key => $meta_val) { $val = in_array($meta_key, $meta) ? 1 : 0; $result_meta[$meta_key] = $val; } } $result_meta = !empty($result_meta) ? $result_meta : $default_meta; extract( $result_meta, EXTR_SKIP ); if( is_home() || is_front_page() || is_search()) { $post_date = amyra_lite_get_theme_mod( 'blog_show_date' ); $author = amyra_lite_get_theme_mod( 'blog_show_author' ); $category = amyra_lite_get_theme_mod( 'blog_show_cat' ); $tag = amyra_lite_get_theme_mod( 'blog_show_tags' ); $blog_show_comment = amyra_lite_get_theme_mod( 'blog_show_comment' ); } elseif( is_category() || is_archive() || is_tag() || is_author() ) { $post_date = amyra_lite_get_theme_mod( 'cat_show_date' ); $author = amyra_lite_get_theme_mod( 'cat_show_author' ); $category = amyra_lite_get_theme_mod( 'cat_show_cat' ); $tag = amyra_lite_get_theme_mod( 'cat_show_tags' ); $blog_show_comment = amyra_lite_get_theme_mod( 'cat_show_comment' ); } if( $post_date || $author || $category || ( $tag && 'post' === get_post_type() ) || !empty( $blog_show_comment ) ){ echo '
'; } // Post Date if( $post_date ) { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $posted_on = '' . $time_string . ''; echo '' . $posted_on . ''; // WPCS: XSS OK. } if( $author ) { echo '' . esc_html(get_the_author()) . ''; } // Post Category if( $category ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'amyra-lite' ) ); if ( $categories_list ) { printf( '%1$s %2$s', esc_html__( 'Categories', 'amyra-lite' ), $categories_list ); // WPCS: XSS OK. } } // Hide category and tag text for pages. if ( $tag && 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html__( ', ', 'amyra-lite' ) ); if ( $tags_list ) { echo '' . $tags_list . ''; // WPCS: XSS OK. } } if ( !empty($blog_show_comment) && !post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; /* translators: %s: post title */ comments_popup_link( sprintf( wp_kses( __( 'Leave a Comment on %s', 'amyra-lite' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } if( $post_date || $author || $category || ( $tag && 'post' === get_post_type() ) || !empty($blog_show_comment) ){ echo '
'; } } /** * Prints HTML with meta information for the categories, tags and comments. */ function amyra_lite_entry_footer() { edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__( 'Edit %s', 'amyra-lite' ), the_title( '"', '"', false ) ), '', '' ); } /** * Change the tag could args * * @param array $args Widget parameters. * * @return mixed */ function amyra_lite_tag_cloud_args( $args ) { $args['largest'] = 1; // Largest tag. $args['smallest'] = 1; // Smallest tag. $args['unit'] = 'em'; // Tag font unit. return $args; } add_filter( 'widget_tag_cloud_args', 'amyra_lite_tag_cloud_args' );