Instantly share code, notes, and snippets.

View Simple Social Follow Widget With CSS Image Sprites
<style>
/*-----Social Follow-----*/
#follow{
border: 2px solid #ACA3A3;
padding: 5px 5px 5px 0px;
overflow: hidden;
display: inline-block;
}
#follow a{
width:32px;
View Add Custom Content After All WordPress Posts
/**
* Add Custom Content After All WordPress Posts By http://goo.gl/ht6fZo
*/
function add_after_post_content($content) {
if(!is_feed() &#038;& !is_home() &#038;& is_singular() &#038;& is_main_query()) {
$content .= '<p>YOUR CONTENT AFTER POST</p>';
}
return $content;
}
add_filter('the_content', 'add_after_post_content');
View Add Missing Alt Tags To WordPress Images
/**
* Add Missing Alt Tags To WordPress Images By http://goo.gl/ht6fZo
*/
function add_alt_tags($content)
{
global $post;
preg_match_all('//', $content, $images);
if(!is_null($images))
{
foreach($images[1] as $index => $value)
View Stop Search Engines From Indexing Search Results
/**
* Stop Search Engines From Indexing Search ResultsBy http://goo.gl/ht6fZo//
*/
<?php if(is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php }?>
View Add rel=”nofollow” To WordPress Comment Reply Links
View Remove Stop Words from URL
/**
* Remove Stop Words from URL By http://goo.gl/ht6fZo//
*/
add_filter('sanitize_title', 'remove_stop_words');
function remove_stop_words($slug) {
if (!is_admin()) return $slug;
$slug = explode('-', $slug);
View Show Top Commenters On WordPress Blog
/**
* Show Top Commenters On WordPress Blog By http://goo.gl/ht6fZo
*/
function top_comment_authors($amount = 5) {
global $wpdb;
$results = $wpdb->get_results('
SELECT
COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url
FROM '.$wpdb->comments.'
WHERE comment_author_email != "" AND comment_type = "" AND comment_approved = 1
View Minimum Comment Limit In WordPress
//Minimum Comment Limit In WordPress by http://goo.gl/ht6fZo//
add_filter( 'preprocess_comment', 'minimal_comment_length' );
function minimal_comment_length( $commentdata ) {
$minimalCommentLength = 15;
if ( strlen( trim( $commentdata['comment_content'] ) ) < $minimalCommentLength )
{
wp_die( 'All comments must be at least ' . $minimalCommentLength . ' characters long.' );
}
View Facebook Comment for Single Posts
/*** Facebook Comment for Single Posts ***/
add_action('genesis_before_comments', 'facebook_comments');
function facebook_comments() {
if (is_single()) { ?>
<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-num-posts="3" data-width="600"></div>
<?php }
}
View Add Facebook Comments on Genesis
<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=226986334093131";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>