How to exclude social sharing from certain pages?
-
I manually added code to show social sharing box on all pages and not just posts. Everything is great except I do not want social sharing box to show on 4 pages.
Here is the code:
<?php if($data[‘social_sharing_box’]): ?>
<?php $nofollow = ”;
if($data[‘nofollow_social_links’]) {
$nofollow = ‘ rel=”nofollow”‘;
} ?>
<div class=”share-box”>
<h4><?php echo __(‘Share This Story, Choose Your Platform!’, ‘Avada’); ?></h4>
<ul class=”social-networks social-networks-<?php echo strtolower($data[‘socialbox_icons_color’]); ?>”>
<?php if($data[‘sharing_facebook’]): ?>
<li class=”facebook”>
&p[title]=<?php the_title(); ?>” target=”_blank”<?php echo $nofollow; ?>>
Facebook
<div class=”popup”>
<div class=”holder”>
<p>Facebook</p>
</div>
</div><?php endif; ?>
<?php if($data[‘sharing_twitter’]): ?>
<li class=”twitter”>
post_title); ?> <?php the_permalink(); ?>” target=”_blank”<?php echo $nofollow; ?>>
Twitter
<div class=”popup”>
<div class=”holder”>
<p>Twitter</p>
</div>
</div><?php endif; ?>
<?php if($data[‘sharing_linkedin’]): ?>
<li class=”linkedin”>
&title=<?php the_title(); ?>” target=”_blank”<?php echo $nofollow; ?>>
LinkedIn
<div class=”popup”>
<div class=”holder”>
<p>LinkedIn</p>
</div>
</div><?php endif; ?>
<?php if($data[‘sharing_reddit’]): ?>
<li class=”reddit”>
&title=<?php the_title(); ?>” target=”_blank”<?php echo $nofollow; ?>>
Reddit
<div class=”popup”>
<div class=”holder”>
<p>Reddit</p>
</div>
</div><?php endif; ?>
<?php if($data[‘sharing_tumblr’]): ?>
<li class=”tumblr”>
&name=<?php echo urlencode($post->post_title); ?>&description=<?php echo urlencode(get_the_excerpt()); ?>” target=”_blank”<?php echo $nofollow; ?>>
Tumblr
<div class=”popup”>
<div class=”holder”>
<p>Tumblr</p>
</div>
</div><?php endif; ?>
<?php if($data[‘sharing_google’]): ?>
<li class=”google”>
” onclick=”javascript:window.open(this.href,
”, ‘menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600’);return false;” target=”_blank”<?php echo $nofollow; ?>>
Google +1
<div class=”popup”>
<div class=”holder”>
<p>Google +1</p>
</div>
</div><?php endif; ?>
<?php if($data[‘sharing_pinterest’]): ?>
<li class=”tf-pinterest”>
<?php $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), ‘full’); ?>
&description=<?php echo urlencode($post->post_title); ?>&media=<?php echo urlencode($full_image[0]); ?>” target=”_blank”<?php echo $nofollow; ?>>
Pinterest
<div class=”popup”>
<div class=”holder”>
<p>Pinterest</p>
</div>
</div><?php endif; ?>
<?php if($data[‘sharing_email’]): ?>
<li class=”email”>
&body=<?php the_permalink(); ?>”>
Email
<div class=”popup”>
<div class=”holder”>
<p>Email</p>
</div>
</div><?php endif; ?>
</div>
<?php endif; ?>Could someone help me to resolve this problem?
Regards,
Predrag
- The topic ‘How to exclude social sharing from certain pages?’ is closed to new replies.