1 Star2 Stars3 Stars4 Stars5 Stars (10 votes, average: 5.00 out of 5)

Simple Share Buttons With No Junk Added

So many webmasters want simple share buttons with no junk added. What do I mean by this? In today’s world of “free plugins” webmasters do not know what they are getting into. When they install a sharing plugin most of the time it is loaded down with junk. This junk are ads or links to websites that the webmaster is unaware of.

Simple Share Buttons With No Junk Added *

I have created a highly customizable share plugin for WordPress. Do not let the code scare you. It is very easy to manipulate this code to your liking.

Edit the Images for the Simple Share Plugin with No Junk Added *

  1. Download the zip file for this plugin. Simple Share Download.
  2. Extract the files if you want to customize it.
  3. Go to the images folder and replace the images with whatever you like.
    • Keep the same file names
    • Keep the same size

Edit the Code for the Simple Share Plugin with No Junk Added *

Unlike many other plugins this one only has 1 file with code. Here is the code. You can delete or rearrange the buttons to whatever you want. See the video for instructions.

Subscribe To My YouTube Channel:
<?php
/* Plugin Name: Max's simple share mee no JUNK ADDED!
 * Description: Lightweight Share Buttons with no junk like ads or links ot other websites!
 * Author: Maximus McCullough
 * Version: .1
 */ 
 function catch_that_image() {
 global $post, $posts;
 $first_img = '';
 ob_start();
 ob_end_clean();
 $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
 $first_img = $matches[1][0];

 if(empty($first_img)) {
 $first_img = plugins_url( '/share/images/noimge.png', dirname(__FILE__) );
 }
 return $first_img;
}
function sharemee($content) {
 if(!is_feed() && !is_home()) {
 $perma=get_permalink( $postid);
 $posttn=catch_that_image();
 $postitle=get_the_title( $ID );
 $content.= ''; $content.= '<a href="http://www.facebook.com/sharer.php?u='.$perma.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/facebook.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="http://twitter.com/share?url='.$perma.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/twitter.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="https://plus.google.com/share?url='.$perma.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/google.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="http://www.digg.com/submit?url='.$perma.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/diggit.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="http://reddit.com/submit?url='.$perma.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/reddit.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$perma.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/linkedin.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="http://pinterest.com/pin/create/button/?url='.$perma.'&media='.$posttn.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/pinterest.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="http://www.stumbleupon.com/submit?url='.$perma.'" target="_blank"> <img id="sharing" src="' . plugins_url( '/share/images/stumbleupon.png', dirname(__FILE__) ) . '" alt="" /></a>'; $content.= '<a href="mailto:?Subject='.$postitle.'&Body=I%20saw%20this%20and%20thought%20of%20you!%20'.$perma.'"> <img id="sharing" src="' . plugins_url( '/share/images/email.png', dirname(__FILE__) ) . '" alt="" /></a>'; } return $content; } add_filter ('the_content', 'sharemee'); ?>
Simple Share Buttons With No Junk Added was last modified: January 10th, 2016 by Maximus Mccullough

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Simple Share Buttons With No Junk Added

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.