merge des contributions mais surement pb avec les lignes de titres de parties

This commit is contained in:
Valentin
2023-08-24 12:06:54 +02:00
6 changed files with 96 additions and 56 deletions
+24 -27
View File
@@ -22,6 +22,7 @@
</thead>
<tbody class="w-full mb-48 lg:w-2/3 block bg-jlg-dark-blue">
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
@@ -32,33 +33,31 @@
);
$query = new WP_Query($args);
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
if (get_post_meta(get_the_ID(), 'Minutage', true)) : ?>
<tr class="border-jlg-light-white border-b font-authentic-60 w-full flex flex-row py-6 isContentPart">
<td class="block text-sm pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Minutage', true) }}</td>
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Images', true) }}</td>
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'VoixOffIn', true) }}</td>
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'BandeSon', true) }}</td>
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Ecrits', true) }}</td>
</tr>
<?php elseif (get_post_meta(get_the_ID(), 'isMainPart', true)) : ?>
<tr class="border-jlg-white border-b font-authentic-90 uppercase w-full flex flex-row py-6 isMainPart">
<td class="pl-0 flex">
<div class="w-2 h-5 bg-jlg-white mr-3"></div>
<div>{{ get_post_meta(get_the_ID(), 'isMainPart', true) }}</div>
</td>
</tr>
<? elseif (get_post_meta(get_the_ID(), 'isSubPart', true)) : ?>
<tr class="border-jlg-white border-b font-authentic-60 w-full flex flex-row py-6 isSubPart">
<td class="pl-0 flex">
<div class="w-2 h-5 bg-jlg-white mr-3"></div>
<div>{{ get_post_meta(get_the_ID(), 'isSubPart', true) }}</div>
</td>
</tr>
<?php endif; ?>
$contenu = get_the_content();
$infosArray = explode("---", $contenu); // Divise le contenu en fonction des séparateurs
// Initialisez des variables pour stocker les informations
$images = isset($infosArray[0]) ? $infosArray[0] : '';
$voixOffIn = isset($infosArray[1]) ? $infosArray[1] : '';
$bandeson = isset($infosArray[2]) ? $infosArray[2] : '';
$ecrits = isset($infosArray[3]) ? $infosArray[3] : '';
//lien pour le crayon
$edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
?>
<tr class="border-jlg-light-white border-b font-authentic-60 w-full flex flex-row py-6 isContentPart">
<td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
<td class="block pl-0 pr-6"><?php echo $images; ?></td>
<td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
<td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
<td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
<td class="block text-sm pl-0 pr-6"><?php if(is_user_logged_in()){ echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';} elseif (!is_user_logged_in()) { echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';}?></td>
</tr>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
@@ -75,6 +74,4 @@
@endif
@endsection
@endsection