Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to add share icon in wordpress

<?php $url = urlencode(get_the_permalink()); $title = htmlspecialchars(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8'); ?>
 
<div class='social-share'>
<a class='fb' target="_blank" href="http://www.facebook.com/sharer.php?u=<?php echo $url;?>">Facebook</a>
<a class='tw' target="_blank" href="https://twitter.com/intent/tweet?url=<?php echo $url;?>&text=<?php echo $title; ?>">Twitter</a>
<a class='pi' href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());">Pinterest</a>
<a class='go' target="_blank" href="https://plus.google.com/share?url=<?php echo $url;?>">Google+</a>
<a class='li' target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo $url;?>">Linkedin </a>
<a class='wh' href="whatsapp://send?text=<?php echo ($title ." ". $url);?>">WhatsApp</a>
<a class='ma' target="_blank" href="mailto:?subject=<?php echo $title;?>&body=%20<?php echo $url;?>">EMAIL</a>
</div>
Comment

PREVIOUS NEXT
Code Example
Php :: check if session is started 
Php :: New Laravel Devcontainer Project Setup 
Php :: valdidate laravel if falid 
Php :: type casting in php 
Php :: create controller with model resources and request command in laravel 
Php :: call to a member function setcookie() on null laravel middleware 
Php :: check if string contains only whitespace php 
Php :: laravel collection pipe 
Php :: fetch method and class in codeigniter 
Php :: in_array php 
Php :: php is_int 
Php :: laravel drop foreign column 
Php :: php json response to ajax 
Php :: wordpress theme development boilerplate 
Php :: if condition in php 
Php :: php 8 match 
Php :: lDownload multiple files as a zip-file using php 
Php :: notify multiple users laravel 
Php :: how to see php error log 
Php :: zip missing php install 
Php :: php define multiple variables as 0 
Php :: new DateInterval 1 hour 
Php :: how to maintain serial number in pagination in laravel blade 
Php :: php using composer autoload - own code 
Php :: wp image size name 
Php :: remove special characters in php 
Php :: php proper function comments 
Php :: git pull using php 
Php :: axios post not sending data php 
Php :: cors error angular php 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =