Advertisement
jegtheme

social sharing

Jan 21st, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. <?php
  2.  
  3. if ( post_password_required() )
  4.     return;
  5.  
  6. $featured_img = wp_get_attachment_url( get_post_thumbnail_id());
  7. $posttitle = get_the_title();
  8. ?>
  9. <div class="article-sharing">
  10.     <div class="sharing-title"><h5>< ?php _e('Share This Article', 'photology-themes'); ?></h5></div>
  11.     <div class="sharing-icons">
  12.         <div class="sharing-icon sharing-facebook socials-share">
  13.             <a data-shareto="Facebook" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo wp_get_shortlink() ? rel="nofollow">"><i class="fa fa-facebook"></i></a>
  14.        </div>
  15.        <div class="sharing-icon sharing-twitter socials-share">
  16.            <a data-shareto="Twitter" target="_blank" href="https://twitter.com/home?status=<?php echo urlencode($posttitle . ". " . esc_url( wp_get_shortlink() )); ? rel="nofollow">"><i class="fa fa-twitter"></i></a>
  17.         </div>
  18.         <div class="sharing-icon sharing-google socials-share">
  19.             <a data-shareto="Google" target="_blank" href="https://plus.google.com/share?url=<?php echo wp_get_shortlink() ? rel="nofollow">"><i class="fa fa-google"></i></a>
  20.         </div>
  21.         <div class="sharing-icon sharing-pinterest socials-share">
  22.             <a data-shareto="Pinterest" target="_blank" href="https://pinterest.com/pin/create/button/?url=<?php echo wp_get_shortlink() ? rel="nofollow">&media=< ?php echo esc_url( $featured_img ); ?>&description=< ?php echo urlencode( get_the_title() ); ?>"><i class="fa fa-pinterest"></i></a>
  23.         </div>
  24.         <div class="sharing-icon sharing-linkedin socials-share">
  25.             <a data-shareto="Linkedin" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo wp_get_shortlink() ? rel="nofollow">&title=< ?php echo urlencode( get_the_title() ) ?>&summary=< ?php echo urlencode( wp_strip_all_tags( get_the_excerpt() )) ?>&source=< ?php echo urlencode( get_bloginfo( 'name' ) ) ?>"><i class="fa fa-linkedin"></i></a>
  26.         </div>
  27.     </div>
  28. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement