diff --git a/functions.php b/functions.php index cf57c08..66d41e4 100644 --- a/functions.php +++ b/functions.php @@ -15,4 +15,3 @@ require_once(__DIR__ . '/includes/templates.php'); require_once(__DIR__ . '/includes/ajax.php'); // require_once(__DIR__ . '/includes/widget.php'); -// require_once( __DIR__ . '/includes/logos.php'); \ No newline at end of file diff --git a/includes/admin.php b/includes/admin.php index 34cc627..785ef7b 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -1,19 +1,6 @@ parent == 0) { + return $thematique; + } else { + return get_term($thematique->parent, 'thematiques'); + } +} + // Get automatic post used in BLOCK QUESTIONS FREQUENTES function get_automatic_post($post_type) @@ -62,3 +76,14 @@ function get_automatic_post($post_type) ); return get_posts($automatic_query_args)[0]; } + + +// TO GET ARCHIVE RELATED PAGES BY TEMPLATE +function get_page_by_template($template = '') +{ + $args = array( + 'meta_key' => '_wp_page_template', + 'meta_value' => $template + ); + return get_pages($args); +} diff --git a/single-conseils.php b/single-conseils.php index 36aa20b..c947d16 100644 --- a/single-conseils.php +++ b/single-conseils.php @@ -34,45 +34,77 @@ function build_chapter_index($blocks) slug); - $thematiqueColorSlug = $thematiqueParent->slug; + $currentThematique = get_the_terms(get_the_ID(), 'thematiques')[0]; + $mainThematique = getMainThematique($currentThematique); + $thematiqueColorSlug = $mainThematique->slug; ?> +
""> + + post_content); $chapterBlockIndex = build_chapter_index($blocks); ?>
- - - + + + - + -
"> - -
+
"> + +
-
+
diff --git a/taxonomy-thematiques.php b/taxonomy-thematiques.php index 1f85a8f..151ebfc 100644 --- a/taxonomy-thematiques.php +++ b/taxonomy-thematiques.php @@ -7,10 +7,6 @@ $thematiqueColorSlug = getThematiqueFamilySlug($thematique_generale->slug); $current_children_thematique = get_queried_object()->parent != 0 ? get_queried_object() : null; -echo '
';
-print_r($thematiqueColorSlug);
-echo '
'; - $args = array( 'posts_per_page' => 1, @@ -28,35 +24,19 @@ $args = array( $query_current_thematique_posts = new WP_Query($args); $thematique_related_page = $query_current_thematique_posts->posts[0]; -echo '
';
-// 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 '
'; -$test = get_term_by('id', 12, 'category'); - - - -// echo '
';
-// print_r($thematique_related_page);
-// echo '
'; - - -// echo $the_query->posts[0]->post_content; +$archiveQuestions = get_page_by_template('template-archive-questions.php')[0]; ?> - + +
parent) : ?>