From ca2f2cf549b63d9cbfee5eef8239adfa8dc6ebee Mon Sep 17 00:00:00 2001 From: Nikola Date: Tue, 12 Dec 2017 08:47:30 +0100 Subject: [PATCH 01/24] Add option to filter by single series --- includes/shortcodes.php | 26 ++++---- includes/template-tags.php | 4 ++ views/archive-wpfc_sermon.php | 117 +++++++++++++--------------------- views/single-wpfc_sermon.php | 58 ++++++++--------- 4 files changed, 93 insertions(+), 112 deletions(-) diff --git a/includes/shortcodes.php b/includes/shortcodes.php index d53947e..bd525a4 100755 --- a/includes/shortcodes.php +++ b/includes/shortcodes.php @@ -612,13 +612,14 @@ function getLatestSeriesImageId( $series = 0 ) { /** * Renders sorting HTML. * - * @param array $atts Shortcode parameters. - * - * @type string $series Force specific series to show. Slug only - * @type string $preachers Force specific preacher to show. Slug only - * @type string $topics Force specific topic to show. Slug only - * @type string $books Force specific book to show. Slug only - * @type string $visibility 'none' to hide the forced fields, 'disable' to show them as disabled and 'suggest' to + * @param array $atts Shortcode parameters. + * + * @type string $series_filter Do filtering in this specific series (slug) + * @type string $series Force specific series to show. Slug only + * @type string $preachers Force specific preacher to show. Slug only + * @type string $topics Force specific topic to show. Slug only + * @type string $books Force specific book to show. Slug only + * @type string $visibility 'none' to hide the forced fields, 'disable' to show them as disabled and 'suggest' to * just set the default value while allowing user to change it. Default 'suggest' * * @return string Sorting HTML @@ -640,11 +641,12 @@ public function displaySermonSorting( $atts = array() ) { // default shortcode options $args = array( - 'series' => '', - 'preachers' => '', - 'topics' => '', - 'books' => '', - 'visibility' => 'suggest', + 'series_filter' => '', + 'series' => '', + 'preachers' => '', + 'topics' => '', + 'books' => '', + 'visibility' => 'suggest', ); // merge default and user options diff --git a/includes/template-tags.php b/includes/template-tags.php index 9ff427a..17b74d9 100755 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -186,6 +186,10 @@ function render_wpfc_sorting( $args = array() ) { + + + diff --git a/views/archive-wpfc_sermon.php b/views/archive-wpfc_sermon.php index d68977d..f6922b8 100644 --- a/views/archive-wpfc_sermon.php +++ b/views/archive-wpfc_sermon.php @@ -1,87 +1,62 @@ +
+ + + + + +
+
-
-
-

- - max_num_pages > 1 ) : ?> - - + + -
-

-
-

- -
-
- + /* + * Include the Post-Format-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 Format name) and that will be used instead. + */ + wpfc_sermon_excerpt(); - -
> -

- - - -

+ endwhile; - + the_posts_pagination( array( + 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '' . __( 'Previous page', 'twentyseventeen' ) . '', + 'next_text' => '' . __( 'Next page', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), + 'before_page_number' => '' . __( 'Page', 'twentyseventeen' ) . ' ', + ) ); -
- -
+ else : -
- - ID ); ?> - approved ), 'sermon-manager-for-wordpress' ) ), number_format_i18n( $approved_comments_count ) ) ); ?> - - | ', '' ); ?> -
-
+ get_template_part( 'template-parts/post/content', 'none' ); - + endif; ?> - max_num_pages > 1 ) : ?> - - +
+
+ +
- - + - diff --git a/views/single-wpfc_sermon.php b/views/single-wpfc_sermon.php index 8fa2ea1..8fc1d76 100755 --- a/views/single-wpfc_sermon.php +++ b/views/single-wpfc_sermon.php @@ -11,32 +11,32 @@ get_header(); ?> -
-
-
> - -

- - - -
- ', '' ); ?> -
- -
- - - - -
-
- - - +
+
+
+
> +

+ + + +
+ ', '' ); ?> +
+
+ + + + +
+
+ +
+ + Date: Tue, 12 Dec 2017 09:27:48 +0100 Subject: [PATCH 02/24] Add option to filter by multiple series --- includes/template-tags.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/template-tags.php b/includes/template-tags.php index 17b74d9..14834a5 100755 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -186,9 +186,16 @@ function render_wpfc_sorting( $args = array() ) { - - + + 1 ): ?> + + + + + +