FEATURE Refining behaviour & introducing share buttons & urls
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
33be80f6fa
commit
fe22d158c9
|
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
$currentPostType = get_post_type();
|
||||
$post_id = get_the_ID();
|
||||
|
||||
if ($currentPostType === 'revues') {
|
||||
$currentRevueID = get_the_ID();
|
||||
}
|
||||
if ($currentPostType === 'articles') {
|
||||
$currentRevueID = get_field('related_revue', get_the_ID());
|
||||
$currentRevueID = get_field('related_revue', $post_id);
|
||||
}
|
||||
if (!$currentRevueID) return;
|
||||
|
||||
|
|
@ -14,7 +15,9 @@ $issueNumber = get_field('issue_number', $currentRevueID);
|
|||
|
||||
$post_type = get_post_type();
|
||||
$hasThumbnail = has_post_thumbnail();
|
||||
$citeReference = get_field('cite_reference', get_the_ID());
|
||||
$citeReference = get_field('cite_reference', $post_id);
|
||||
|
||||
$likes_count = get_post_likes_count($post_id);
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -69,11 +72,13 @@ $citeReference = get_field('cite_reference', get_the_ID());
|
|||
<img src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-citer-article.svg" alt="">
|
||||
Citer
|
||||
</button>
|
||||
<button class="socials-buttons__button socials-buttons__button--like">
|
||||
<button class="socials-buttons__button socials-buttons__button--like is-disabled" data-likes-count="<?php echo $likes_count; ?>">
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-soutenir.svg" alt="">
|
||||
J'aime
|
||||
<span class="likes-count"><?php echo $likes_count; ?></span>
|
||||
<span class="button-action-text">J'aime</span>
|
||||
|
||||
</button>
|
||||
<button class="socials-buttons__button socials-buttons__button--share">
|
||||
<button class="socials-buttons__button socials-buttons__button--share" data-share-url="<?php echo get_the_permalink(); ?>">
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-partager-social.svg" alt="">
|
||||
Partager
|
||||
</button>
|
||||
|
|
@ -82,4 +87,30 @@ $citeReference = get_field('cite_reference', get_the_ID());
|
|||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$published = $args['published'] ?? null;
|
||||
$modified = $args['modified'] ?? null;
|
||||
|
||||
|
||||
$shareUrls = build_share_urls();
|
||||
write_log($shareUrls);
|
||||
?>
|
||||
|
||||
<div class="post-infos-capsule">
|
||||
|
||||
<ul class="post-infos-capsule__share">
|
||||
<?php foreach ($shareUrls as $key => $shareUrl) : ?>
|
||||
<li class="share-button share-button--<?php echo $key ?>">
|
||||
<a href='<?php echo $shareUrl ?>' class="share-link" target="_blank" title="<?php echo __("Partager ce contenu sur ", "homegrade-theme__texte-fonctionnel") . $key ?>">
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user