Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //adds social share in AMP pages add in function.php /WP
- add_filter('the_content', 'my_social_share');
- function my_social_share($content) {
- if(is_single()) {
- $before_after_content = '<div class=social-share>
- <amp-social-share width=35 height=35 type=facebook data-param-app_id=xxxxxxxxxxxxx></amp-social-share>
- <amp-social-share height=35 width=35 type=twitter></amp-social-share>
- <amp-social-share height=35 width=35 type="system"></amp-social-share>
- </div>';
- $share_content = $before_after_content . $content . $before_after_content;
- } else {
- $share_content = $content;
- }
- return $share_content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement