Version Description
- Fix column width issue when content is disabled
- Fix pagination issue when post list is on the front page
- Disable pagination in single posts
- Fix saving of taxonomy and terms fields
- Force no underline on read more buttons
Download this release
Release Info
Developer | edge22 |
Plugin | WP Show Posts |
Version | 0.4 |
Comparing to | |
See all releases |
Code changes from version 0.3 to 0.4
- admin/js/admin-scripts.js +5 -4
- css/wp-show-posts-min.css +1 -1
- css/wp-show-posts.css +6 -0
- inc/defaults.php +2 -1
- inc/functions.php +3 -2
- license.txt +7 -1
- readme.txt +15 -1
- wp-show-posts.php +39 -9
admin/js/admin-scripts.js
CHANGED
@@ -30,7 +30,7 @@ function wpsp_get_terms( type = 'post' ) {
|
|
30 |
return response.responseJSON;
|
31 |
}
|
32 |
|
33 |
-
function wpsp_get_option( key = '
|
34 |
var response = jQuery.getJSON({
|
35 |
type: 'POST',
|
36 |
url: ajaxurl,
|
@@ -54,14 +54,15 @@ jQuery( document ).ready( function( $ ) {
|
|
54 |
|
55 |
// Populate taxonomy select based on current post type value
|
56 |
var taxonomies = wpsp_get_taxonomy( $( '#wpsp-post-type' ).val() );
|
|
|
57 |
$('#wpsp-taxonomy').append( $( '<option></option>' ) );
|
58 |
$.each(taxonomies, function(key, value) {
|
59 |
$('#wpsp-taxonomy').append( $( '<option></option>' ).attr( 'value', value ).text( value ) );
|
60 |
});
|
61 |
|
62 |
// Set the selected taxonomy value on load
|
63 |
-
$( '#wpsp-taxonomy' ).val( wpsp_get_option( '
|
64 |
-
|
65 |
var terms = wpsp_get_terms( $( '#wpsp-taxonomy' ).val() );
|
66 |
$('#wpsp-terms').append( $( '<option></option>' ) );
|
67 |
$.each(terms, function(key, value) {
|
@@ -69,7 +70,7 @@ jQuery( document ).ready( function( $ ) {
|
|
69 |
});
|
70 |
|
71 |
// Set the selected term value on load
|
72 |
-
$( '#wpsp-terms' ).val( wpsp_get_option( '
|
73 |
|
74 |
// Hide the terms of taxonomy is empty on load
|
75 |
if ( '' == $( '#wpsp-taxonomy' ).val() )
|
30 |
return response.responseJSON;
|
31 |
}
|
32 |
|
33 |
+
function wpsp_get_option( key = 'wpsp_taxonomy' ) {
|
34 |
var response = jQuery.getJSON({
|
35 |
type: 'POST',
|
36 |
url: ajaxurl,
|
54 |
|
55 |
// Populate taxonomy select based on current post type value
|
56 |
var taxonomies = wpsp_get_taxonomy( $( '#wpsp-post-type' ).val() );
|
57 |
+
|
58 |
$('#wpsp-taxonomy').append( $( '<option></option>' ) );
|
59 |
$.each(taxonomies, function(key, value) {
|
60 |
$('#wpsp-taxonomy').append( $( '<option></option>' ).attr( 'value', value ).text( value ) );
|
61 |
});
|
62 |
|
63 |
// Set the selected taxonomy value on load
|
64 |
+
$( '#wpsp-taxonomy' ).val( wpsp_get_option( 'wpsp_taxonomy' ) );
|
65 |
+
|
66 |
var terms = wpsp_get_terms( $( '#wpsp-taxonomy' ).val() );
|
67 |
$('#wpsp-terms').append( $( '<option></option>' ) );
|
68 |
$.each(terms, function(key, value) {
|
70 |
});
|
71 |
|
72 |
// Set the selected term value on load
|
73 |
+
$( '#wpsp-terms' ).val( wpsp_get_option( 'wpsp_tax_term' ) );
|
74 |
|
75 |
// Hide the terms of taxonomy is empty on load
|
76 |
if ( '' == $( '#wpsp-taxonomy' ).val() )
|
css/wp-show-posts-min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
body .wp-show-posts a{box-shadow:0 0 0 transparent}.wp-show-posts-entry-title a{text-decoration:none}a.wp-show-posts-read-more,a.wp-show-posts-read-more:visited{display:inline-block;padding:8px 15px;border:2px solid #222;border-radius:3px;color:#222;font-size:0.8em}.wpsp-read-more{margin:0 0 1em;display:inline-block}a.wp-show-posts-read-more:hover,a.wp-show-posts-read-more:focus{border:2px solid transparent;color:#fff;background:#222}.wp-show-posts-image{margin-bottom:1em}.wp-show-posts-image.wpsp-image-left{float:left;margin-right:1.5em}.wp-show-posts-image.wpsp-image-right{float:right;margin-left:1.5em}.wp-show-posts-image.wpsp-image-center{display:block;text-align:center}.wp-show-posts-image img{margin:0 !important;vertical-align:bottom}.wp-show-posts-entry-header{margin:0 0 1em;padding:0}.wp-show-posts .wp-show-posts-entry-title{font-size:30px;line-height:35px;margin:0}.wp-show-posts-updated{display:none}.wp-show-posts-entry-summary,.wp-show-posts-entry-content{margin-bottom:1em}.wp-show-posts-entry-meta{font-size:0.8em;color:rgba( 0,0,0,0.5 )}.wp-show-posts-meta a,.wp-show-posts-meta a:visited{color:rgba( 0,0,0,0.5 )}.stack-wp-show-posts-byline,.stack-wp-show-posts-posted-on{display:block}.wp-show-posts-entry-meta-below-post{margin-bottom:1em}.wp-show-posts-columns:not(.wp-show-posts-masonry){display:flex;flex-wrap:wrap}.wp-show-posts-columns .wp-show-posts-single:not(.wp-show-posts-masonry-block){display:flex;flex-direction:row}.wp-show-posts-columns .wp-show-posts-single:not(.wp-show-posts-masonry-block) .wp-show-posts-image img{flex:0 0 auto;object-fit:scale-down}.wpsp-clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.wp-show-posts:not(.wp-show-posts-columns) .wp-show-posts-single:not(:last-child){margin-bottom:2em}.wp-show-posts-columns .wp-show-posts-entry-title{font-size:25px}.wp-show-posts-columns .wp-show-posts-single.col-md-4 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-3 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-20 .wp-show-posts-entry-title{font-size:20px}@media (min-width: 768px){.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-20{float:left}.col-1{width:8.333333%}.col-2{width:16.666667%}.col-3{width:25%}.col-4{width:33.333%}.col-5{width:41.666667%}.col-6{width:50%}.col-7{width:58.333333%}.col-8{width:66.666667%}.col-9{width:75%}.col-10{width:83.333333%}.col-11{width:91.666667%}.col-12{width:100%}.col-20{width:20%}}.wp-show-posts-inner *:last-child{margin-bottom:0}.screen-reader-text{clip:rect(1px, 1px, 1px, 1px);position:absolute !important}.screen-reader-text:hover,.screen-reader-text:active,.screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);clip:auto !important;color:#21759b;display:block;font-size:14px;font-weight:bold;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wpsp-clearfix:after{content:".";display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}
|
1 |
+
body .wp-show-posts a{box-shadow:0 0 0 transparent}.wp-show-posts-entry-title a{text-decoration:none}a.wp-show-posts-read-more,a.wp-show-posts-read-more:visited{display:inline-block;padding:8px 15px;border:2px solid #222;border-radius:3px;color:#222;font-size:0.8em;text-decoration:none}.wpsp-read-more{margin:0 0 1em;display:inline-block}a.wp-show-posts-read-more:hover,a.wp-show-posts-read-more:focus{border:2px solid transparent;color:#fff;background:#222;text-decoration:none}.wp-show-posts-image{margin-bottom:1em}.wp-show-posts-image.wpsp-image-left{float:left;margin-right:1.5em}.wp-show-posts-image.wpsp-image-right{float:right;margin-left:1.5em}.wp-show-posts-image.wpsp-image-center{display:block;text-align:center}.wp-show-posts-image img{margin:0 !important;vertical-align:bottom}.wp-show-posts-entry-header{margin:0 0 1em;padding:0}.wp-show-posts .wp-show-posts-entry-title{font-size:30px;line-height:35px;margin:0}.wp-show-posts-updated{display:none}.wp-show-posts-entry-summary,.wp-show-posts-entry-content{margin-bottom:1em}.wp-show-posts-entry-meta{font-size:0.8em;color:rgba( 0,0,0,0.5 )}.wp-show-posts-meta a,.wp-show-posts-meta a:visited{color:rgba( 0,0,0,0.5 )}.stack-wp-show-posts-byline,.stack-wp-show-posts-posted-on{display:block}.wp-show-posts-entry-meta-below-post{margin-bottom:1em}.wp-show-posts-columns:not(.wp-show-posts-masonry){display:flex;flex-wrap:wrap}.wp-show-posts-columns .wp-show-posts-single:not(.wp-show-posts-masonry-block){display:flex;flex-direction:row}.wp-show-posts-columns .wp-show-posts-single:not(.wp-show-posts-masonry-block) .wp-show-posts-image img{flex:0 0 auto;object-fit:scale-down}.wpsp-clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.wp-show-posts:not(.wp-show-posts-columns) .wp-show-posts-single:not(:last-child){margin-bottom:2em}.wp-show-posts-columns .wp-show-posts-entry-title{font-size:25px}.wp-show-posts-columns .wp-show-posts-single.col-md-4 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-3 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-20 .wp-show-posts-entry-title{font-size:20px}.wp-show-posts-columns .wp-show-posts-inner{flex:1}@media (min-width: 768px){.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-20{float:left}.col-1{width:8.333333%}.col-2{width:16.666667%}.col-3{width:25%}.col-4{width:33.333%}.col-5{width:41.666667%}.col-6{width:50%}.col-7{width:58.333333%}.col-8{width:66.666667%}.col-9{width:75%}.col-10{width:83.333333%}.col-11{width:91.666667%}.col-12{width:100%}.col-20{width:20%}}.wp-show-posts-inner *:last-child{margin-bottom:0}.screen-reader-text{clip:rect(1px, 1px, 1px, 1px);position:absolute !important}.screen-reader-text:hover,.screen-reader-text:active,.screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);clip:auto !important;color:#21759b;display:block;font-size:14px;font-weight:bold;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wpsp-clearfix:after{content:".";display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}
|
css/wp-show-posts.css
CHANGED
@@ -14,6 +14,7 @@ a.wp-show-posts-read-more:visited {
|
|
14 |
border-radius: 3px;
|
15 |
color: #222;
|
16 |
font-size: 0.8em;
|
|
|
17 |
}
|
18 |
|
19 |
.wpsp-read-more {
|
@@ -26,6 +27,7 @@ a.wp-show-posts-read-more:focus {
|
|
26 |
border: 2px solid transparent;
|
27 |
color: #fff;
|
28 |
background: #222;
|
|
|
29 |
}
|
30 |
|
31 |
.wp-show-posts-image {
|
@@ -128,6 +130,10 @@ a.wp-show-posts-read-more:focus {
|
|
128 |
font-size: 20px;
|
129 |
}
|
130 |
|
|
|
|
|
|
|
|
|
131 |
/* Bootstrap grid system */
|
132 |
@media (min-width: 768px) {
|
133 |
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col-20 {
|
14 |
border-radius: 3px;
|
15 |
color: #222;
|
16 |
font-size: 0.8em;
|
17 |
+
text-decoration: none;
|
18 |
}
|
19 |
|
20 |
.wpsp-read-more {
|
27 |
border: 2px solid transparent;
|
28 |
color: #fff;
|
29 |
background: #222;
|
30 |
+
text-decoration: none;
|
31 |
}
|
32 |
|
33 |
.wp-show-posts-image {
|
130 |
font-size: 20px;
|
131 |
}
|
132 |
|
133 |
+
.wp-show-posts-columns .wp-show-posts-inner {
|
134 |
+
flex: 1;
|
135 |
+
}
|
136 |
+
|
137 |
/* Bootstrap grid system */
|
138 |
@media (min-width: 768px) {
|
139 |
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col-20 {
|
inc/defaults.php
CHANGED
@@ -68,7 +68,8 @@ function wpsp_get_defaults()
|
|
68 |
'wpsp_read_more_style' => 'hollow',
|
69 |
'wpsp_read_more_color' => 'black',
|
70 |
'wpsp_border' => '',
|
71 |
-
'wpsp_padding' => ''
|
|
|
72 |
);
|
73 |
|
74 |
return apply_filters( 'wpsp_defaults', $defaults );
|
68 |
'wpsp_read_more_style' => 'hollow',
|
69 |
'wpsp_read_more_color' => 'black',
|
70 |
'wpsp_border' => '',
|
71 |
+
'wpsp_padding' => '',
|
72 |
+
'wpsp_filter' => false
|
73 |
);
|
74 |
|
75 |
return apply_filters( 'wpsp_defaults', $defaults );
|
inc/functions.php
CHANGED
@@ -382,8 +382,9 @@ function wpsp_pagination( $max_num_pages ) {
|
|
382 |
if ( $max_num_pages < 2 ) {
|
383 |
return;
|
384 |
}
|
385 |
-
|
386 |
-
$
|
|
|
387 |
$pagenum_link = html_entity_decode( get_pagenum_link() );
|
388 |
$query_args = array();
|
389 |
$url_parts = explode( '?', $pagenum_link );
|
382 |
if ( $max_num_pages < 2 ) {
|
383 |
return;
|
384 |
}
|
385 |
+
|
386 |
+
$paged_query = is_front_page() ? 'page' : 'paged';
|
387 |
+
$paged = get_query_var( $paged_query ) ? intval( get_query_var( $paged_query ) ) : 1;
|
388 |
$pagenum_link = html_entity_decode( get_pagenum_link() );
|
389 |
$query_args = array();
|
390 |
$url_parts = explode( '?', $pagenum_link );
|
license.txt
CHANGED
@@ -20,4 +20,10 @@ Icons generated with IcoMoon with the following licenses:
|
|
20 |
Font License: SIL OFL 1.1 - http://scripts.sil.org/OFL
|
21 |
Code License: MIT License - http://opensource.org/licenses/mit-license.html
|
22 |
|
23 |
-
All brand icons are trademarks of their respective owners.
|
|
|
|
|
|
|
|
|
|
|
|
20 |
Font License: SIL OFL 1.1 - http://scripts.sil.org/OFL
|
21 |
Code License: MIT License - http://opensource.org/licenses/mit-license.html
|
22 |
|
23 |
+
All brand icons are trademarks of their respective owners.
|
24 |
+
|
25 |
+
= Display Posts Shortcode =
|
26 |
+
|
27 |
+
Some of the base code of this plugin was borrowed from the awesome Display Posts Shortcode plugin by Bill Erickson.
|
28 |
+
https://wordpress.org/plugins/display-posts-shortcode/
|
29 |
+
http://www.billerickson.net/
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpshowposts.com
|
|
4 |
Tags: show posts, display posts shortcode, portfolio, gallery, post columns
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.6
|
7 |
-
Stable tag: 0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -147,6 +147,13 @@ In most cases, #1 will work fine and is way easier.
|
|
147 |
|
148 |
== Changelog ==
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
= 0.3 =
|
151 |
* Remove attachment post type from list for now
|
152 |
* Don't show pagination if there's no posts
|
@@ -164,6 +171,13 @@ In most cases, #1 will work fine and is way easier.
|
|
164 |
|
165 |
== Upgrade Notice ==
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
= 0.3 =
|
168 |
* Remove attachment post type from list for now
|
169 |
* Don't show pagination if there's no posts
|
4 |
Tags: show posts, display posts shortcode, portfolio, gallery, post columns
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.6
|
7 |
+
Stable tag: 0.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
147 |
|
148 |
== Changelog ==
|
149 |
|
150 |
+
= 0.4 =
|
151 |
+
* Fix column width issue when content is disabled
|
152 |
+
* Fix pagination issue when post list is on the front page
|
153 |
+
* Disable pagination in single posts
|
154 |
+
* Fix saving of taxonomy and terms fields
|
155 |
+
* Force no underline on read more buttons
|
156 |
+
|
157 |
= 0.3 =
|
158 |
* Remove attachment post type from list for now
|
159 |
* Don't show pagination if there's no posts
|
171 |
|
172 |
== Upgrade Notice ==
|
173 |
|
174 |
+
= 0.4 =
|
175 |
+
* Fix column width issue when content is disabled
|
176 |
+
* Fix pagination issue when post list is on the front page
|
177 |
+
* Disable pagination in single posts
|
178 |
+
* Fix saving of taxonomy and terms fields
|
179 |
+
* Force no underline on read more buttons
|
180 |
+
|
181 |
= 0.3 =
|
182 |
* Remove attachment post type from list for now
|
183 |
* Don't show pagination if there's no posts
|
wp-show-posts.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Show Posts
|
4 |
Plugin URI: https://wpshowposts.com
|
5 |
Description: WP Show Posts allows you to list posts (from any post type) anywhere on your site. This includes WooCommerce products or any other post type you might have! Check out the pro version for even more features at https://wpshowposts.com.
|
6 |
-
Version: 0.
|
7 |
Author: Tom Usborne
|
8 |
Author URI: https://tomusborne.com
|
9 |
License: GNU General Public License v2 or later
|
@@ -12,7 +12,7 @@ Text Domain: wp-show-posts
|
|
12 |
*/
|
13 |
|
14 |
// Define the current version
|
15 |
-
define( 'WPSP_VERSION', 0.
|
16 |
|
17 |
// Add defaults
|
18 |
require_once trailingslashit( plugin_dir_path( __FILE__ ) ) . 'inc/defaults.php';
|
@@ -126,6 +126,7 @@ function wpsp_display( $id )
|
|
126 |
$featured_post = wp_validate_boolean( wpsp_get_setting( $id, 'wpsp_featured_post' ) );
|
127 |
$border = wpsp_sanitize_hex_color( wpsp_get_setting( $id, 'wpsp_border' ) );
|
128 |
$padding = sanitize_text_field( wpsp_get_setting( $id, 'wpsp_padding' ) );
|
|
|
129 |
|
130 |
// Grab initiate args for query
|
131 |
$args = array();
|
@@ -157,8 +158,10 @@ function wpsp_display( $id )
|
|
157 |
if ( '' !== $author )
|
158 |
$args[ 'author' ] = array( $author );
|
159 |
|
160 |
-
if ( $pagination )
|
161 |
-
$
|
|
|
|
|
162 |
|
163 |
// Post Status
|
164 |
$post_status = explode( ', ', $post_status );
|
@@ -261,6 +264,14 @@ function wpsp_display( $id )
|
|
261 |
wp_enqueue_script( 'jquery-masonry' );
|
262 |
wp_add_inline_script( 'jquery-masonry', 'jQuery(function($){var $container = $(".wp-show-posts-masonry");$container.imagesLoaded( function(){$container.fadeIn( 1000 ).masonry({itemSelector : ".wp-show-posts-masonry-block",columnWidth: ".grid-sizer"}).css("opacity","1");});});' );
|
263 |
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
|
265 |
// Add the default inner wrapper class
|
266 |
// We don't create the class element up here like below, as we need to add classes inside the loop below as well
|
@@ -290,6 +301,15 @@ function wpsp_display( $id )
|
|
290 |
|
291 |
do_action( 'wpsp_before_wrapper' );
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
// Start the wrapper
|
294 |
echo '<' . $wrapper . $wrapper_id . $wrapper_class . $wrapper_style . '>';
|
295 |
|
@@ -304,8 +324,9 @@ function wpsp_display( $id )
|
|
304 |
while ( $query->have_posts() ) {
|
305 |
$query->the_post();
|
306 |
|
307 |
-
// Get page
|
308 |
-
$
|
|
|
309 |
|
310 |
$featured = '';
|
311 |
$column_class = '';
|
@@ -320,10 +341,18 @@ function wpsp_display( $id )
|
|
320 |
$column_class .= ' ' . $columns;
|
321 |
endif;
|
322 |
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
// Start inner container
|
326 |
-
echo '<' . $inner_wrapper . ' class="' . implode( ' ', $inner_wrapper_class ) . $column_class . $featured . '" itemtype="http://schema.org/' . $itemtype . '" itemscope>';
|
327 |
echo '<div class="wp-show-posts-inner"' . $inner_wrapper_style . '>';
|
328 |
|
329 |
do_action( 'wpsp_before_header' );
|
@@ -373,8 +402,9 @@ function wpsp_display( $id )
|
|
373 |
do_action( 'wpsp_after_wrapper' );
|
374 |
|
375 |
// Pagination
|
376 |
-
if ( $pagination && $query->have_posts() ) :
|
377 |
if ( $ajax_pagination && function_exists( 'wpsp_ajax_pagination' ) ) :
|
|
|
378 |
$max_page = $query->max_num_pages;
|
379 |
$nextpage = intval( $paged ) + 1;
|
380 |
|
3 |
Plugin Name: WP Show Posts
|
4 |
Plugin URI: https://wpshowposts.com
|
5 |
Description: WP Show Posts allows you to list posts (from any post type) anywhere on your site. This includes WooCommerce products or any other post type you might have! Check out the pro version for even more features at https://wpshowposts.com.
|
6 |
+
Version: 0.4
|
7 |
Author: Tom Usborne
|
8 |
Author URI: https://tomusborne.com
|
9 |
License: GNU General Public License v2 or later
|
12 |
*/
|
13 |
|
14 |
// Define the current version
|
15 |
+
define( 'WPSP_VERSION', 0.4 );
|
16 |
|
17 |
// Add defaults
|
18 |
require_once trailingslashit( plugin_dir_path( __FILE__ ) ) . 'inc/defaults.php';
|
126 |
$featured_post = wp_validate_boolean( wpsp_get_setting( $id, 'wpsp_featured_post' ) );
|
127 |
$border = wpsp_sanitize_hex_color( wpsp_get_setting( $id, 'wpsp_border' ) );
|
128 |
$padding = sanitize_text_field( wpsp_get_setting( $id, 'wpsp_padding' ) );
|
129 |
+
$filter = wp_validate_boolean( wpsp_get_setting( $id, 'wpsp_filter' ) );
|
130 |
|
131 |
// Grab initiate args for query
|
132 |
$args = array();
|
158 |
if ( '' !== $author )
|
159 |
$args[ 'author' ] = array( $author );
|
160 |
|
161 |
+
if ( $pagination && ! is_single() ) :
|
162 |
+
$paged_query = is_front_page() ? 'page' : 'paged';
|
163 |
+
$args[ 'paged' ] = get_query_var( $paged_query );
|
164 |
+
endif;
|
165 |
|
166 |
// Post Status
|
167 |
$post_status = explode( ', ', $post_status );
|
264 |
wp_enqueue_script( 'jquery-masonry' );
|
265 |
wp_add_inline_script( 'jquery-masonry', 'jQuery(function($){var $container = $(".wp-show-posts-masonry");$container.imagesLoaded( function(){$container.fadeIn( 1000 ).masonry({itemSelector : ".wp-show-posts-masonry-block",columnWidth: ".grid-sizer"}).css("opacity","1");});});' );
|
266 |
endif;
|
267 |
+
|
268 |
+
// Filter
|
269 |
+
// if ( $filter ) :
|
270 |
+
// wp_enqueue_script( 'wpsp-imagesloaded' );
|
271 |
+
// wp_enqueue_script( 'wpsp-filterizr' );
|
272 |
+
// wp_add_inline_script( 'wpsp-filterizr', 'jQuery(function($){ var $filterizd = $( ".wp-show-posts" );$filterizd.imagesLoaded( function(){ $( ".wp-show-posts" ).filterizr("setOptions", {layout: "sameWidth"}); } )});' );
|
273 |
+
// $inner_wrapper_class[] = 'filtr-item';
|
274 |
+
// endif;
|
275 |
|
276 |
// Add the default inner wrapper class
|
277 |
// We don't create the class element up here like below, as we need to add classes inside the loop below as well
|
301 |
|
302 |
do_action( 'wpsp_before_wrapper' );
|
303 |
|
304 |
+
// if ( $filter ) :
|
305 |
+
// $post_terms = get_terms( sanitize_text_field( $taxonomy ), 'orderby=count&hide_empty=1' );
|
306 |
+
// echo '<ul>';
|
307 |
+
// foreach ( $post_terms as $term ) {
|
308 |
+
// echo '<li data-filter="' . $term->term_id . '">' . $term->name . '</li>';
|
309 |
+
// }
|
310 |
+
// echo '</ul>';
|
311 |
+
// endif;
|
312 |
+
|
313 |
// Start the wrapper
|
314 |
echo '<' . $wrapper . $wrapper_id . $wrapper_class . $wrapper_style . '>';
|
315 |
|
324 |
while ( $query->have_posts() ) {
|
325 |
$query->the_post();
|
326 |
|
327 |
+
// Get page
|
328 |
+
$paged_query = is_front_page() ? 'page' : 'paged';
|
329 |
+
$paged = ( get_query_var( $paged_query ) ) ? get_query_var( $paged_query ) : 1;
|
330 |
|
331 |
$featured = '';
|
332 |
$column_class = '';
|
341 |
$column_class .= ' ' . $columns;
|
342 |
endif;
|
343 |
|
344 |
+
$terms_list = '';
|
345 |
+
// if ( $filter ) :
|
346 |
+
// $terms_list = wp_get_post_terms( get_the_ID(), $taxonomy );
|
347 |
+
// $output_terms = array();
|
348 |
+
// foreach ( $terms_list as $term ) {
|
349 |
+
// $output_terms[] = $term->term_id;
|
350 |
+
// }
|
351 |
+
// $terms_list = 'data-category="' . implode( ', ', $output_terms ) . '"';
|
352 |
+
// endif;
|
353 |
|
354 |
// Start inner container
|
355 |
+
echo '<' . $inner_wrapper . ' class="' . implode( ' ', $inner_wrapper_class ) . $column_class . $featured . '" itemtype="http://schema.org/' . $itemtype . '" itemscope ' . $terms_list . '>';
|
356 |
echo '<div class="wp-show-posts-inner"' . $inner_wrapper_style . '>';
|
357 |
|
358 |
do_action( 'wpsp_before_header' );
|
402 |
do_action( 'wpsp_after_wrapper' );
|
403 |
|
404 |
// Pagination
|
405 |
+
if ( $pagination && $query->have_posts() && ! is_single() ) :
|
406 |
if ( $ajax_pagination && function_exists( 'wpsp_ajax_pagination' ) ) :
|
407 |
+
|
408 |
$max_page = $query->max_num_pages;
|
409 |
$nextpage = intval( $paged ) + 1;
|
410 |
|