Skip to content

Instantly share code, notes, and snippets.

@shemul49rmc
shemul49rmc / Social Share Buttons Without Javascript or Plugins_codes
Created November 2, 2013 13:54
Fast Loading Colorful Social Share Buttons Without Javascript or Plugins
<div class="social">
<p>Share This Post on:</p>
<!--Facebook-->
<a class="facebook" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>">Facebook</a>
<!--Twitter-->
<a class="twitter" href="http://twitter.com/home/?status=<?php the_title();?> - <?php echo wp_get_shortlink();?> via @Shemul49rmc "title="Tweet this!" rel="nofollow" target="_blank">Twitter</a>
<!--Google Plus-->
<a class="google-plus" target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="window.open('https://plus.google.com/share?url=<?php the_permalink(); ?>','gplusshare','width=600,height=400,left='+(screen.availWidth/2-225)+',top='+(screen.availHeight/2-150)+'');return false;">Google+</a>
<!--Reddit-->
<a class="reddit" href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Reddit" rel="nofollow" target="_blank">Reddit</a>
@shemul49rmc
shemul49rmc / Add Social Share Buttons
Last active January 29, 2020 15:32
Add Social Share Buttons
<b>Share This:</b>
<a target="_blank" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>"> <img src="http://i.minus.com/i1UqMXjOhoUzH.jpg" alt="Facebook" width="64" height="64"></a> |
<a href="http://twitter.com/share?text=<?php echo urlencode(the_title()); ?>&url=<?php echo urlencode(the_permalink()); ?>&via=shemul49rmc&related=<?php echo urlencode("shemul49rmc:Support me"); ?>" title="Share on Twitter" rel="nofollow" target="_blank"><img src="http://i.minus.com/ibmtAwKz1BAcLO.png" alt="Twitter" width="64" height="64"></a> |
<a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="window.open('https://plus.google.com/share?url=<?php the_permalink(); ?>','gplusshare','width=600,height=400,left='+(screen.availWidth/2-225)+',top='+(screen.availHeight/2-150)+'');return false;"><img src="http://i.minus.com/izAImJGqELkX1.png" alt="Google Plus" width="64" height="64"></a> |
<div>
<a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp
@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 / 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 / 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 / Add rel=”nofollow” To WordPress Comment Reply Links
Created December 13, 2013 09:44
Add rel=”nofollow” To WordPress Comment Reply Links
@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 / 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 / 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.' );
}