How To Remove Default Author Profile Fields In WordPress
With the help of following snippet, you will be able to remove default author profile fields in WordPress.
1 2 3 4 5 6 7 |
add_filter('user_contactmethods','hide_profile_fields',10,1); function hide_profile_fields( $contactmethods ) { unset($contactmethods['aim']); unset($contactmethods['jabber']); unset($contactmethods['yim']); return $contactmethods; } |
Snippet Source/Credit: Snipplr
How To Remove Standard Gallery Style
Adding the following snippet to your theme’s functions.php file, you will be able to remove WordPress standard gallery style.
1 |
add_filter( 'use_default_gallery_style', '__return_false' ); |
How To Add Custom Pinterest Button
Using the following snippet will let you add custom pinterest button in your WordPress website.
Add to your header above the body tag
1 |
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script> |
Edit and add to your page where you want your button to appear.
1 |
<div class="socialIcon-box"><a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fyourdomain.com&media=<?php bloginfo(template_directory); ?>/images/youricon.png&description=Site%20Name%20and%20Description" class="pin-it-button" count-layout="horizontal"><img src="<?php bloginfo(template_directory); ?>/images/youricon.png" /></a></div> |
Snippet Source/Credit: flashalexander.com
How To Add Facebook Comments In Your Website
Using the following line of codes below, you will be able to add Facebook comments in your website.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=Your App ID Here"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <meta property="fb:app_id" content="Your App ID Here"/> <div class="fb-comments" data-href="<?php the_permalink() ?>" data-num-posts="2" data-width="470" data-colorscheme="light" data-mobile="false"></div> // Get combined FB and WordPress comment count function get_full_comment_count() { global $post; $url = get_permalink($post->ID); $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url); $json = json_decode($filecontent); $count = $json->$url->comments; $wpCount = get_comments_number(); $realCount = $count + $wpCount; if ($realCount == 0 || !isset($realCount)) { $realCount = 0; } return $realCount; } function the_full_comment_count() { $realCount = get_full_comment_count(); echo $realCount; } Snippet Source/Credit: TutsPlus How To Clean Dashboard Meta Boxes The following snippet will let you clean dashboard meta boxes in WordPress. remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' ); } add_action( 'admin_init', 'remove_dashboard_meta' ); |
Snippet Source/Credit: WordPress Codex