Skip to content

Instantly share code, notes, and snippets.

@shemul49rmc
shemul49rmc / Facebook Pop up Plugin for Blogger:
Last active August 29, 2015 13:55
Facebook Pop up Plugin for Blogger
<style type='text/css'>
#iamshemulpopup{
position: fixed;
top:100px;
z-index:9999;
display:none;
padding:0px;
right:600px;
border:10px solid rgba(82, 82, 82, 0.7);
-webkit-background-clip: padding-box; /* for Safari */
@shemul49rmc
shemul49rmc / Add Custom Content After All WordPress Posts
Last active December 31, 2015 05:39
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');
@shemul49rmc
shemul49rmc / Stop Search Engines From Indexing Search Results
Created December 13, 2013 09:49
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 }?>
@shemul49rmc
shemul49rmc / Remove Stop Words from URL
Created December 13, 2013 09:48
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);
@shemul49rmc
shemul49rmc / Add Missing Alt Tags To WordPress Images
Created December 13, 2013 09:46
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)
@shemul49rmc
shemul49rmc / Show Top Commenters On WordPress Blog
Last active December 31, 2015 05:39
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
@shemul49rmc
shemul49rmc / Add rel=”nofollow” To WordPress Comment Reply Links
Created December 13, 2013 09:44
Add rel=”nofollow” To WordPress Comment Reply Links
@shemul49rmc
shemul49rmc / Minimum Comment Limit In WordPress
Created December 13, 2013 09:40
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.' );
}
@shemul49rmc
shemul49rmc / Simple Social Follow Widget With CSS Image Sprites
Last active March 21, 2017 17:56
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;
@shemul49rmc
shemul49rmc / Facebook Comment for Single Posts
Last active December 29, 2015 10:38
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 }
}