Last active
April 16, 2021 13:08
-
-
Save Niq1982/3c3ae20b95add98217e0292e74140fef to your computer and use it in GitHub Desktop.
Social icons functionality for WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use same social icon component in single post share links | |
*/ | |
$social_share_links = [ | |
'facebook' => [ | |
'url' => 'https://www.facebook.com/sharer/sharer.php?u=' . get_permalink(), | |
'title' => 'Jaa artikkeli Facebookissa', | |
], | |
'twitter' => [ | |
'url' => 'https://twitter.com/share?url=' . get_permalink() . '&text=' . get_the_excerpt(), | |
'title' => 'Jaa artikkeli Twitterissä', | |
], | |
'linkedin' => [ | |
'url' => 'https://www.linkedin.com/sharing/share-offsite/?url=' . get_permalink(), | |
'title' => 'Yleinen: Jaa artikkeli Linkedinissä', | |
] | |
]; | |
get_template_part( 'template-parts/social-icons', '', [ 'social_icons' => $social_share_links ] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment