feat: add global flags
This commit is contained in:
parent
4b10a0e515
commit
840f111e75
2 changed files with 18 additions and 0 deletions
17
components/globalflag.php
Normal file
17
components/globalflag.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php $flags = get_terms(
|
||||||
|
array(
|
||||||
|
'taxonomy' => 'flag',
|
||||||
|
'hide_empty' => false,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($flags) {
|
||||||
|
foreach( $flags as $flag ) {
|
||||||
|
if ($flag->slug == "global") {
|
||||||
|
$term_meta = get_option( "taxonomy_term_$flag->term_id" );
|
||||||
|
echo "<div class='toast toast-" . $term_meta['niveau'] . "'>";
|
||||||
|
echo $flag->description;
|
||||||
|
echo "</div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ?>
|
1
home.php
1
home.php
|
@ -1,5 +1,6 @@
|
||||||
<?php get_header(); ?>
|
<?php get_header(); ?>
|
||||||
<main>
|
<main>
|
||||||
|
<?php include(TEMPLATEPATH . '/components/globalflag.php'); ?>
|
||||||
|
|
||||||
<!-- Recuperation de la page de home -->
|
<!-- Recuperation de la page de home -->
|
||||||
<?php if ( !is_paged() ) {
|
<?php if ( !is_paged() ) {
|
||||||
|
|
Reference in a new issue