Last active
December 29, 2020 18:20
-
-
Save premanshup/e625fa0be290e54771cc3fba16951310 to your computer and use it in GitHub Desktop.
Add icons before entry meta - Author, Date & Comment ( Dashicons )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Update Search Nothing Found String and Search Input Box Placeholder Strings | |
* | |
* @param array $strings List of default strings used in theme | |
* @return array $strings | |
*/ | |
function default_strings_callback( $strings ) { | |
// Replace by with empty string. | |
$strings['string-blog-meta-author-by'] = ''; | |
return $strings; | |
} | |
add_filter( 'astra_default_strings', 'default_strings_callback', 10 ); | |
add_filter( 'astra_post_author', 'function_to_add_author_icon' ); | |
function function_to_add_author_icon( $output ) { | |
$output = '<span class="dashicons dashicons-admin-users"></span>' . $output; | |
return $output; | |
} | |
add_filter( 'astra_post_date', 'function_to_add_post_date_icon' ); | |
function function_to_add_post_date_icon( $output ) { | |
$output = '<span class="dashicons dashicons-calendar-alt"></span>' . $output; | |
return $output; | |
} | |
add_filter( 'astra_post_comments', 'function_to_add_post_comment_icon' ); | |
function function_to_add_post_comment_icon( $output ) { | |
if( ! empty( $output ) ) { | |
$output = '<span class="dashicons dashicons-format-chat"></span>' . $output; | |
} | |
return $output; | |
} | |
add_filter( 'astra_post_meta_separator', 'astra_remove_meta_separator' ); | |
function astra_remove_meta_separator( $separator ) { | |
$separator = '|'; | |
return $separator; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment