Deligraph-V3/single.php
2025-09-25 11:59:36 +02:00

166 lines
6.3 KiB
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php get_header();
$cats = get_the_category();
$wpseo_primary_term = new WPSEO_Primary_Term( 'category', get_the_id() );
$wpseo_primary_term = $wpseo_primary_term->get_primary_term();
$term = get_term( $wpseo_primary_term );
//print_r($term);
//foreach ($cats as $cat) {
if($term->slug == 'web-design')
{
$classColor = 'agenceWeb';
}elseif($term->slug == 'graphisme')
{
$classColor = 'studioGraphique';
}elseif($term->slug == 'video')
{
$classColor = 'productionAudiovisuelle';
}elseif($term->slug == 'e-marketing')
{
$classColor = 'inboundMarketing';
}elseif($term->slug == 'formation')
{
$classColor = 'formationSurMesure';
}
if($term->slug == 'web-design-en')
{
$classColor = 'agenceWeb';
}elseif($term->slug == 'graphisme-en')
{
$classColor = 'studioGraphique';
}elseif($term->slug == 'video-en')
{
$classColor = 'productionAudiovisuelle';
}elseif($term->slug == 'e-marketing-en')
{
$classColor = 'inboundMarketing';
}elseif($term->slug == 'formation-en')
{
$classColor = 'formationSurMesure';
}
//}
?>
<div class="container <?php echo $classColor; ?>">
<div class="row">
<div class="col-12">
<div class="circle"></div>
</div>
<div class="col-lg-8 ">
<div class="barre"></div>
<h1><?php the_title(); ?></h1>
<?php the_post_thumbnail();?>
<div class="barre"></div>
<?php if (ICL_LANGUAGE_CODE == 'en'): ?>
<p class="auteur">Writing : <?php echo get_the_author();?></p>
<p class="tempsDeLecture">Allow 
<?php
if(!empty(get_field('temps_de_lecture'))):
echo get_field('temps_de_lecture');
else:
?>
<span class="eta"></span> 
<?php
endif;
?>
minutes to read this article :)
</p>
<?php else: ?>
<p class="auteur">Rédaction : <?php echo get_the_author();?></p>
<p class="tempsDeLecture">Comptez 
<?php
if(!empty(get_field('temps_de_lecture'))):
echo get_field('temps_de_lecture');
else:
?>
<span class="eta"></span> 
<?php
endif;
?>
minutes pour lire cet article :)
</p>
<?php endif; ?>
<div class="contenu"><?php the_content(); ?></div>
</div>
<div class="col-lg-4 sidebar">
<ul>
<?php
// check if the repeater field has rows of data
if( have_rows('sujet_en_lien') ):
// loop through the rows of data
?>
<?php if (ICL_LANGUAGE_CODE == 'en'): ?>
<?php else: ?>
<h2 class="sujets">Sujets en relation avec cet article</h2>
<?php endif; ?>
<?php
while ( have_rows('sujet_en_lien') ) : the_row();
// display a sub field value
$lien = get_sub_field('lien_du_sujet');
//print_r($lien);
?>
<li><a href="<?php echo $lien->guid; ?>"><?php echo $lien->post_title; ?></a></li>
<?php
endwhile;
else :
// no rows found
endif;
?>
<?php
// check if the repeater field has rows of data
if( have_rows('services_en_relation') ):
?>
<h2 class="services">Services en relation avec cet article</h2>
<?php
// loop through the rows of data
while ( have_rows('services_en_relation') ) : the_row();
// display a sub field value
$lienService = get_sub_field('lien_du_service');
//print_r($lienService);
?>
<li><a href="<?php echo $lienService->guid; ?>"><?php echo $lienService->post_title; ?></a></li>
<?php
endwhile;
else :
// no rows found
endif;
?>
<?php
// check if the repeater field has rows of data
if( have_rows('formation_en_relation') ):
// loop through the rows of data
?>
<h2 class="formations">Formations en relation avec cet article</h2>
<?php
while ( have_rows('formation_en_relation') ) : the_row();
// display a sub field value
$lienFormation = get_sub_field('lien_de_la_formation');
?>
<li><a href="<?php echo $lienFormation->guid; ?>"><?php echo $lienFormation->post_title; ?></a></li>
<?php
endwhile;
else :
// no rows found
endif;
?>
<div class="crawler"></div>
<div class="domaineBloc">
<?php if (ICL_LANGUAGE_CODE == 'en'): ?>
<h2 class="domaines">What we do</h2>
<?php else: ?>
<h2 class="domaines">Nos domaines dactivité</h2>
<?php endif; ?>
<?php
wp_nav_menu( array(
'menu' => 'domaines - beta',
) );
?>
</div>
</ul>
</div>
</div>
</div>
<?php get_footer(); ?>