diff --git a/archive.php b/archive.php index e3681b13..640e224f 100755 --- a/archive.php +++ b/archive.php @@ -13,7 +13,7 @@
- + - ' ); - if ( $sunflower_parsed_blocks ) { - echo '
'; - foreach ( $sunflower_parsed_blocks as $sunflower_block ) { - echo wp_kses_post( render_block( $sunflower_block ) ); - } - echo '
'; - } - ?> - __( 'next', 'sunflower' ), ); - printf( - '
%s
', - wp_kses_post( paginate_links( $sunflower_args ) ) - ); - - else : + $sunflower_paginated_links = paginate_links( $sunflower_args ); + if ( $sunflower_paginated_links ) { + printf( + '
%s
', + wp_kses_post( $sunflower_paginated_links ) + ); + } + } else { get_template_part( 'template-parts/content', 'none' ); - - endif; + } ?>
diff --git a/category.php b/category.php new file mode 100755 index 00000000..d8201715 --- /dev/null +++ b/category.php @@ -0,0 +1,121 @@ + +
+
+
+
+ + + + + false, + 'hierarchical' => false, + 'parent' => 0, + 'orderby' => 'name', + 'hide_empty' => true, + 'show_option_none' => '', + 'title_li' => '', + ); + + if ( 'only-subcategories' === $sunflower_categories_archive_setting ) { + $sunflower_args['parent'] = $cat; + } + + if ( 'no' !== $sunflower_categories_archive_setting ) { + $sunflower_categories_archive = wp_list_categories( $sunflower_args ); + + if ( $sunflower_categories_archive ) { + echo '
    '; + echo wp_kses_post( $sunflower_categories_archive ); + echo '
'; + } + } + + /* Start the Loop */ + $sunflower_list_items = ''; + while ( have_posts() ) { + + the_post(); + + /* + * Include the Post-Type-specific template for the content. + * If you want to override this in a child theme, then include a file + * called content-___.php (where ___ is the Post Type name) and that will be used instead. + */ + ob_start(); + get_template_part( 'template-parts/content', 'archive' ); + + $sunflower_article = ob_get_clean(); + + $sunflower_list_items .= sprintf( + '
%s
', + $sunflower_article + ); + + } + ?> + +
+ array( + 'class' => true, + 'datetime' => true, + ), + ) + ) + ); + ?> +
+ __( 'previous', 'sunflower' ), + 'next_text' => __( 'next', 'sunflower' ), + ); + + $sunflower_paginated_links = paginate_links( $sunflower_args ); + + if ( $sunflower_paginated_links ) { + printf( + '
%s
', + wp_kses_post( $sunflower_paginated_links ) + ); + } + } else { + get_template_part( 'template-parts/content', 'none' ); + + } + + ?> + +
+
+
+
+sunflower_categories_archive( ... ), + 'sunflower-setting-admin', + 'sunflower_layout', + array( 'sunflower_categories_filter', __( 'Show list of categories on category archive', 'sunflower' ) ) + ); } /** @@ -248,13 +257,41 @@ public function sunflower_contact_form_to(): void { public function sunflower_header_layout(): void { echo ''; + } + + /** + * Header layout variant field + */ + public function sunflower_categories_archive(): void { + echo '