86 lines
2.1 KiB
PHP
86 lines
2.1 KiB
PHP
<?php get_header();
|
|
|
|
// $term = get_queried_object();
|
|
// $term_test = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
|
|
|
|
$current_general_thematique = get_queried_object()->parent ? get_term(get_queried_object()->parent, 'thematiques') : get_term(get_queried_object(), 'thematiques');
|
|
$current_children_thematique = get_queried_object()->parent != 0 ? get_queried_object() : null;
|
|
|
|
|
|
|
|
$args = array(
|
|
'posts_per_page' => 1,
|
|
'post_type' => 'conseils',
|
|
'tax_query' => array(
|
|
array(
|
|
'slug' => 'locations',
|
|
'taxonomy' => 'thematiques',
|
|
'field' => 'slug',
|
|
'terms' => get_queried_object()->slug,
|
|
// 'include_children' => false,
|
|
)
|
|
)
|
|
);
|
|
$query_current_thematique_posts = new WP_Query($args);
|
|
$thematique_related_page = $query_current_thematique_posts->posts[0];
|
|
|
|
echo '<pre>';
|
|
// print_r($term);
|
|
// print_r($term_test);
|
|
// print_r($query_current_thematique_posts->posts);
|
|
// print_r($thematique_related_page);
|
|
// print_r($current_children_thematique);
|
|
// print_r($current_thematique);
|
|
// print_r(is_tax('thematiques', 'thematiques'));
|
|
echo '</pre>';
|
|
|
|
|
|
$test = get_term_by('id', 12, 'category');
|
|
|
|
|
|
if ($term->parent == 0) {
|
|
$args = array(
|
|
'child_of' => $term->term_id,
|
|
'taxonomy' => $term->taxonomy,
|
|
'hide_empty' => 0,
|
|
'hierarchical' => true,
|
|
'depth' => 1,
|
|
);
|
|
wp_list_categories($args);
|
|
}
|
|
|
|
// echo '<pre>';
|
|
// print_r($thematique_related_page);
|
|
// echo '</pre>';
|
|
|
|
|
|
// echo $the_query->posts[0]->post_content;
|
|
?>
|
|
<div class="breadcrumb-thematiques">
|
|
<ul>
|
|
<li>
|
|
<a href="">Home ></a>
|
|
</li>
|
|
<li>
|
|
<a href="<?php echo get_term_link($current_general_thematique) ?>"><?php echo $current_general_thematique->name ?></a>
|
|
</li>
|
|
<?php if ($current_children_thematique) : ?>
|
|
<li>
|
|
<a href="<?php echo get_term_link($current_children_thematique) ?>"><?php echo $current_children_thematique->name ?></a>
|
|
</li>
|
|
<?php endif; ?>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
<div class="container my-8 mx-auto">
|
|
|
|
<?php
|
|
echo $thematique_related_page->post_content;
|
|
?>
|
|
</div>
|
|
|
|
<?php
|
|
get_footer();
|