FEATURE Hiding authors and references if no values encoded
This commit is contained in:
parent
c897e2e656
commit
23edc2b1f4
|
|
@ -1,4 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
$id = get_the_ID();
|
||||||
|
$reference = get_field('references', $id);
|
||||||
|
$hasReferences = isset($reference) && is_array($reference) && count($reference) > 0;
|
||||||
|
$authors = get_field('authors', $id);
|
||||||
|
$hasAuthors = isset($authors) && is_array($authors) && count($authors) > 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
@ -8,15 +15,18 @@
|
||||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-document.svg" alt="">
|
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-document.svg" alt="">
|
||||||
Article
|
Article
|
||||||
</button>
|
</button>
|
||||||
<button id="tab-2" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-2" tabindex="-1" data-tab="authors">
|
<?php if ($hasAuthors) : ?>
|
||||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-plume.svg" alt="">
|
<button id="tab-2" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-2" tabindex="-1" data-tab="authors">
|
||||||
|
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-plume.svg" alt="">
|
||||||
Auteur·e·s
|
Auteur·e·s
|
||||||
</button>
|
</button>
|
||||||
<button id="tab-3" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-3" tabindex="-1" data-tab="references">
|
<?php endif; ?>
|
||||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-lien.svg" alt="">
|
<?php if ($hasReferences) : ?>
|
||||||
Références
|
<button id="tab-3" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-3" tabindex="-1" data-tab="references">
|
||||||
</button>
|
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-lien.svg" alt="">
|
||||||
|
Références
|
||||||
|
</button>
|
||||||
|
<?php endif; ?>
|
||||||
<button id="tab-4" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-4" tabindex="-1" data-tab="table-of-contents">
|
<button id="tab-4" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-4" tabindex="-1" data-tab="table-of-contents">
|
||||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-plan.svg" alt="">
|
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-plan.svg" alt="">
|
||||||
Table des matières
|
Table des matières
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user