handling when no jobs
This commit is contained in:
parent
0063545bbc
commit
65a8769861
File diff suppressed because one or more lines are too long
|
|
@ -8,38 +8,36 @@ $args = array(
|
||||||
|
|
||||||
$offresEmplois = new WP_Query($args);
|
$offresEmplois = new WP_Query($args);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
||||||
<?php echo $content; ?>
|
<?php echo $content; ?>
|
||||||
|
<?php if (!$offresEmplois->have_posts()) : ?>
|
||||||
|
<p><?php echo __("Il n’y a pas de poste à pourvoir en ce moment.", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($offresEmplois->have_posts()) : ?>
|
||||||
|
<ul class="homegrade-blocks-offres-emplois__offres-grid-datas">
|
||||||
|
|
||||||
<ul class="homegrade-blocks-offres-emplois__offres-grid-datas">
|
<div class="table_head">
|
||||||
|
<p><?php echo __("Poste", "homegrade-blocks") ?></p>
|
||||||
|
<p><?php echo __("Offre", "homegrade-blocks") ?></p>
|
||||||
|
</div>
|
||||||
|
<?php foreach ($offresEmplois->posts as $offre) : ?>
|
||||||
|
<?php
|
||||||
|
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
||||||
|
$offrePermalink = get_the_permalink($offre->ID);
|
||||||
|
get_the_content($offre->ID);
|
||||||
|
?>
|
||||||
|
<li class="homegrade-blocks-offres-emplois__offre">
|
||||||
|
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
||||||
|
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo $contractType ?></p>
|
||||||
|
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
||||||
|
|
||||||
<div class="table_head">
|
</li>
|
||||||
<p><?php echo __("Poste", "homegrade-blocks") ?></p>
|
<?php endforeach; ?>
|
||||||
<p><?php echo __("Offre", "homegrade-blocks") ?></p>
|
|
||||||
</div>
|
|
||||||
<?php foreach ($offresEmplois->posts as $offre) : ?>
|
|
||||||
<?php
|
|
||||||
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
|
||||||
$offrePermalink = get_the_permalink($offre->ID);
|
|
||||||
get_the_content($offre->ID);
|
|
||||||
?>
|
|
||||||
<li class="homegrade-blocks-offres-emplois__offre">
|
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo $contractType ?></p>
|
|
||||||
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
|
||||||
|
|
||||||
</li>
|
</ul>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -8,38 +8,36 @@ $args = array(
|
||||||
|
|
||||||
$offresEmplois = new WP_Query($args);
|
$offresEmplois = new WP_Query($args);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
||||||
<?php echo $content; ?>
|
<?php echo $content; ?>
|
||||||
|
<?php if (!$offresEmplois->have_posts()) : ?>
|
||||||
|
<p><?php echo __("Il n’y a pas de poste à pourvoir en ce moment.", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($offresEmplois->have_posts()) : ?>
|
||||||
|
<ul class="homegrade-blocks-offres-emplois__offres-grid-datas">
|
||||||
|
|
||||||
<ul class="homegrade-blocks-offres-emplois__offres-grid-datas">
|
<div class="table_head">
|
||||||
|
<p><?php echo __("Poste", "homegrade-blocks") ?></p>
|
||||||
|
<p><?php echo __("Offre", "homegrade-blocks") ?></p>
|
||||||
|
</div>
|
||||||
|
<?php foreach ($offresEmplois->posts as $offre) : ?>
|
||||||
|
<?php
|
||||||
|
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
||||||
|
$offrePermalink = get_the_permalink($offre->ID);
|
||||||
|
get_the_content($offre->ID);
|
||||||
|
?>
|
||||||
|
<li class="homegrade-blocks-offres-emplois__offre">
|
||||||
|
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
||||||
|
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo $contractType ?></p>
|
||||||
|
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
||||||
|
|
||||||
<div class="table_head">
|
</li>
|
||||||
<p><?php echo __("Poste", "homegrade-blocks") ?></p>
|
<?php endforeach; ?>
|
||||||
<p><?php echo __("Offre", "homegrade-blocks") ?></p>
|
|
||||||
</div>
|
|
||||||
<?php foreach ($offresEmplois->posts as $offre) : ?>
|
|
||||||
<?php
|
|
||||||
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
|
||||||
$offrePermalink = get_the_permalink($offre->ID);
|
|
||||||
get_the_content($offre->ID);
|
|
||||||
?>
|
|
||||||
<li class="homegrade-blocks-offres-emplois__offre">
|
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo $contractType ?></p>
|
|
||||||
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
|
||||||
|
|
||||||
</li>
|
</ul>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
Loading…
Reference in New Issue
Block a user