From fd5d3a7e5faea0c328514517504ab92003cbe0ea Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 4 Jan 2021 12:00:40 +0100 Subject: [PATCH] chore: split article template --- components/article.php | 45 +++--------------------------- components/article/breadcrumb.php | 10 +++++++ components/article/description.php | 9 ++++++ components/article/flags.php | 9 ++++++ components/article/terms.php | 13 +++++++++ 5 files changed, 45 insertions(+), 41 deletions(-) create mode 100644 components/article/breadcrumb.php create mode 100644 components/article/description.php create mode 100644 components/article/flags.php create mode 100644 components/article/terms.php diff --git a/components/article.php b/components/article.php index 6c263e2..e2d81b7 100644 --- a/components/article.php +++ b/components/article.php @@ -1,26 +1,7 @@ -
- -
- + -ID, 'flag'); -if ($flags) { - foreach( $flags as $flag ) { - $term_meta = get_option( "taxonomy_term_$flag->term_id" ); - echo "
"; - echo $flag->description; - echo "
"; - } -} ?> - +
@@ -40,29 +21,11 @@ if ($flags) { - $value ) { - echo "
" . $value . "
"; - } - } - ?> + diff --git a/components/article/breadcrumb.php b/components/article/breadcrumb.php new file mode 100644 index 0000000..b1cebd0 --- /dev/null +++ b/components/article/breadcrumb.php @@ -0,0 +1,10 @@ + diff --git a/components/article/description.php b/components/article/description.php new file mode 100644 index 0000000..c1aabe1 --- /dev/null +++ b/components/article/description.php @@ -0,0 +1,9 @@ + $value ) { + echo "
" . $value . "
"; + } + } +?> diff --git a/components/article/flags.php b/components/article/flags.php new file mode 100644 index 0000000..072d66e --- /dev/null +++ b/components/article/flags.php @@ -0,0 +1,9 @@ +ID, 'flag'); +if ($flags) { + foreach( $flags as $flag ) { + $term_meta = get_option( "taxonomy_term_$flag->term_id" ); + echo "
"; + echo $flag->description; + echo "
"; + } +} ?> diff --git a/components/article/terms.php b/components/article/terms.php new file mode 100644 index 0000000..ab35bed --- /dev/null +++ b/components/article/terms.php @@ -0,0 +1,13 @@ +term_id ) ) . "' class='btn-small btn-info'> " . $category->cat_name . ""; + } + + $tags = get_the_tags(); + if ($tags) { + foreach( $tags as $tag ) { + echo " " . $tag->name . " "; + } + } +?>