diff --git a/js/frontend/main.js b/js/frontend/main.js index 0cf7f3b5..bdb621ab 100644 --- a/js/frontend/main.js +++ b/js/frontend/main.js @@ -832,16 +832,29 @@ jQuery(document).ready(function($){ */ $(document).on( 'click', '.dslc-post-filter', function(){ - // Get info - var dslcCat = $(this).data('id'); - var dslcPosts = $(this).closest('.dslc-module-front').find('.dslc-post'); - var dslcFilterPosts = $(this).closest('.dslc-module-front').find('.dslc-post[data-cats*="' + dslcCat + '"]'); - var dslcNotFilterPosts = $(this).closest('.dslc-module-front').find('.dslc-post:not([data-cats*="' + dslcCat + '"])'); - var dslcContainer = dslcPosts.closest('.dslc-posts'); - var dslcWrapper = $(this).closest('.dslc-module-front'); + // Get info. + var selectedFilterEl = $(this); + var dslcContainer = selectedFilterEl.closest('.dslc-module-front').find('.dslc-posts'); + var dslcWrapper = selectedFilterEl.closest('.dslc-module-front'); + + // Filter posts according to selected filter. + var dslcCat = selectedFilterEl.data('filter-id'); + var dslcFilterPosts = $(); // Empty jQuery object. + var dslcNotFilterPosts = $(); + + if ( dslcCat === 'show-all' ) { + + dslcFilterPosts = dslcContainer.closest('.dslc-module-front').find('.dslc-post'); + dslcNotFilterPosts = $(); // Empty jQuery object. + + } else { + + dslcFilterPosts = dslcContainer.closest('.dslc-module-front').find('.dslc-post[data-cats*="' + dslcCat + '"]'); + dslcNotFilterPosts = dslcContainer.closest('.dslc-module-front').find('.dslc-post:not([data-cats*="' + dslcCat + '"])'); + } // Set active - $(this).removeClass('dslc-inactive').addClass('dslc-active').siblings('.dslc-active').removeClass('dslc-active').addClass('dslc-inactive'); + selectedFilterEl.removeClass('dslc-inactive').addClass('dslc-active').siblings('.dslc-active').removeClass('dslc-active').addClass('dslc-inactive'); if ( dslcContainer.hasClass('dslc-init-grid' ) ) { diff --git a/modules/blog/module.php b/modules/blog/module.php index 5a7202a0..5033d17a 100644 --- a/modules/blog/module.php +++ b/modules/blog/module.php @@ -3344,10 +3344,10 @@ function output( $options ) { ?>
- > + > $cat_name ) : ?> - +
diff --git a/modules/downloads/module.php b/modules/downloads/module.php index 0b14a68d..ffcfe997 100644 --- a/modules/downloads/module.php +++ b/modules/downloads/module.php @@ -2707,11 +2707,10 @@ function output( $options ) { ?>
- - + > $cat_name ) : ?> - +
diff --git a/modules/galleries/module.php b/modules/galleries/module.php index 001599d8..2d5b4f3f 100644 --- a/modules/galleries/module.php +++ b/modules/galleries/module.php @@ -2793,11 +2793,10 @@ function output( $options ) { ?>
- - + > $cat_name ) : ?> - +
diff --git a/modules/partners/module.php b/modules/partners/module.php index 0b87cd6d..e2e4f6c9 100644 --- a/modules/partners/module.php +++ b/modules/partners/module.php @@ -1785,11 +1785,10 @@ function output( $options ) { ?>
- - + > $cat_name ) : ?> - +
diff --git a/modules/posts/module.php b/modules/posts/module.php index 501e68fb..68eefa47 100644 --- a/modules/posts/module.php +++ b/modules/posts/module.php @@ -2874,10 +2874,10 @@ function output( $options ) { ?>
- > + > $cat_name ) : ?> - +
diff --git a/modules/projects/module.php b/modules/projects/module.php index 4acd9482..63c4303a 100644 --- a/modules/projects/module.php +++ b/modules/projects/module.php @@ -2614,11 +2614,10 @@ function output( $options ) { ?>
- - + > $cat_name ) : ?> - +
diff --git a/modules/staff/module.php b/modules/staff/module.php index c6ba88f7..d2b72166 100644 --- a/modules/staff/module.php +++ b/modules/staff/module.php @@ -2448,11 +2448,10 @@ function output( $options ) { ?>
- - + > $cat_name ) : ?> - +
diff --git a/modules/testimonials/module.php b/modules/testimonials/module.php index 196c4436..ee372b0b 100644 --- a/modules/testimonials/module.php +++ b/modules/testimonials/module.php @@ -2183,11 +2183,10 @@ function output( $options ) { ?>
- - + > $cat_name ) : ?> - +
diff --git a/modules/woocommerce/module.php b/modules/woocommerce/module.php index 17a27cdf..e300f116 100644 --- a/modules/woocommerce/module.php +++ b/modules/woocommerce/module.php @@ -2862,11 +2862,10 @@ function output( $options ) { ?>
- - + > $cat_name ) : ?> - +
diff --git a/readme.txt b/readme.txt index b7e832de..30bc7719 100644 --- a/readme.txt +++ b/readme.txt @@ -155,6 +155,8 @@ The Page Builder Sandwich available on WordPress.org is a light version of Page * Issue [#196](https://github.com/livecomposer/live-composer-page-builder/issues/196): Uncaught Error – cannot call methods on sortable prior to initialization; attempted to call method 'option' * Issue [#202](https://github.com/livecomposer/live-composer-page-builder/issues/202): Inline Editor – Bold, Italic text styling do not apply in some themes. * Issue [#193](https://github.com/livecomposer/live-composer-page-builder/issues/193): Navigation Module – Chevron not showing when enabled in navigation module +* Issue [#276](https://github.com/livecomposer/live-composer-page-builder/issues/276): Post Filters – "All" button instead showing all the posts, is hiding them at all + * Presets: Fixed presets auto-reload on module options change. (Thank you Paul!) * Presets: Removed Infobox > Image and Infobox > Image Url form synchronization. (Thank you Paul!) * Post Grids: Wrong post title centering over thumbnail. (Thank you Jacob!)