Author Bio Excerpt
The snippet below will let you have the author bio excerpt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?php // Paste the code below to the functions.php file inside the theme directory you're using. function author_excerpt (){ $word_limit = 20; // Limit the number of words $more_txt = 'read more about:'; // The read more text $txt_end = '...'; // Display text end $authorName = get_the_author(); $authorUrl = get_author_posts_url( get_the_author_meta('ID')); $authorDescription = explode(" ", get_the_author_meta('description')); $displayAuthorPageLink = count($authorDescription) > $word_limit ? $txt_end.' '.$more_txt.' <a href="'.$authorUrl.'">'.$authorName.'</a>' : '' ; $authorDescriptionShort = array_slice($authorDescription, 0, ($word_limit)); return (implode($authorDescriptionShort, ' ')).$displayAuthorPageLink; } ?> <?php // Add this code snippet to the single.php file where you like to display the author bio excerpt. if (function_exists('author_excerpt')){echo author_excerpt();} ?> |
Disable Self Trackbacks
The following snippet will let you disable self trackbacks.
1 2 3 4 5 6 7 8 |
<?php function disable_self_ping( &$links ) { foreach ( $links as $l => $link ) if ( 0 === strpos( $link, get_option( 'home' ) ) ) unset($links[$l]); } add_action( 'pre_ping', 'disable_self_ping' ); ?> |
Remove Login Shake
The following