fixing twitter integration
This commit is contained in:
parent
99c0b7e0cd
commit
bec2767531
|
|
@ -9,7 +9,7 @@ if (!function_exists('build_share_urls')) {
|
||||||
$postUrl = get_permalink($postID);
|
$postUrl = get_permalink($postID);
|
||||||
$postTitle = get_the_title($postID);
|
$postTitle = get_the_title($postID);
|
||||||
$facebookUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl;
|
$facebookUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl;
|
||||||
$twitterUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl;
|
$twitterUrl = 'https://twitter.com/intent/tweet?text=' . $postTitle . '&url=' . get_the_permalink(get_the_id());
|
||||||
$linkedInUrl = 'https://www.linkedin.com/feed/?shareActive=true&text=' . $postTitle . ' ' . $postUrl;
|
$linkedInUrl = 'https://www.linkedin.com/feed/?shareActive=true&text=' . $postTitle . ' ' . $postUrl;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
@ -30,6 +30,7 @@ $shareUrls = build_share_urls($postID);
|
||||||
<?php
|
<?php
|
||||||
__('Partager sur', 'homegrade-theme__texte-fonctionnel')
|
__('Partager sur', 'homegrade-theme__texte-fonctionnel')
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php foreach ($shareUrls as $key => $shareUrl) : ?>
|
<?php foreach ($shareUrls as $key => $shareUrl) : ?>
|
||||||
<a class="share-button share-button--<?php echo $key ?>" href='<?php echo $shareUrl ?>' target="_blank" title="<?php echo __("Partager ce contenu sur", "homegrade-theme__texte-fonctionnel") . $key ?>">
|
<a class="share-button share-button--<?php echo $key ?>" href='<?php echo $shareUrl ?>' target="_blank" title="<?php echo __("Partager ce contenu sur", "homegrade-theme__texte-fonctionnel") . $key ?>">
|
||||||
<?php if ($key) : ?>
|
<?php if ($key) : ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user