How To Add A Google+ Button To Your Posts
Using the following snippet, you will be able to add a Google+ button to your posts.
1 2 3 4 5 6 7 8 9 |
add_filter('the_content', 'wpr_google_plusone'); function wpr_google_plusone($content) { $content = $content.'<div class="plusone"><g:plusone size="tall" href="'.get_permalink().'"></g:plusone></div>'; return $content; } add_action ('wp_enqueue_scripts','wpr_google_plusone_script'); function wpr_google_plusone_script() { wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null); } |
Snippet Source/Credit: SpyResStudios
How To Add Gravatars For The Post Author
Using the following snippet, you will be able to add Gravatars for the post author.
1 |
<?php echo get_avatar( get_the_author_email(), '80' ); ?> |
Snippet Source/Credit: emoticode
How To Change Author URL Base
Using the following snippet, you will be able to change author URL base.
1 2 3 4 5 6 |
add_action('init', 'cng_author_base'); function cng_author_base() { global $wp_rewrite; $author_slug = 'profile'; // change slug name $wp_rewrite->author_base = $author_slug; } |
Snippet Source/Credit: Kevin Chard
How To Redirect To A Custom Page After Registration
Using the following snippet, you will be able to redirect to a custom page after registration.
1 2 3 4 |
function __my_registration_redirect(){ return home_url( '/my-page' ); } add_filter( 'registration_redirect', '__my_registration_redirect' ); |
Snippet Source/Credit: TheDeadMedic