Post Grid - Version 2.1.10

Version Description

  • 2021-07-31 add - featured image improved for responsive load.
Download this release

Release Info

Developer pickplugins
Plugin Icon 128x128 Post Grid
Version 2.1.10
Comparing to
See all releases

Code changes from version 2.1.9 to 2.1.10

Files changed (3) hide show
  1. includes/functions.php +21 -7
  2. post-grid.php +2 -2
  3. readme.txt +5 -2
includes/functions.php CHANGED
@@ -506,21 +506,35 @@ function post_grid_media($post_id, $args ){
506
  $thumb_custom_url = isset($post_settings['thumb_custom_url']) ? $post_settings['thumb_custom_url'] : '';
507
 
508
 
509
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), $image_size );
510
- $alt_text = get_post_meta(get_post_thumbnail_id($post_id), '_wp_attachment_image_alt', true);
511
- $thumb_url = isset($thumb['0']) ? $thumb['0'] : '';
 
 
512
 
513
- if(!empty($thumb_url)){
 
 
 
 
 
 
514
  if($link_to=='post_link'){
515
  if(!empty($thumb_custom_url)){
516
- $html_thumb.= '<a target="'.$link_target.'" href="'.$thumb_custom_url.'"><img alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
 
 
517
  }
518
  else{
519
- $html_thumb.= '<a target="'.$link_target.'" href="'.$item_post_permalink.'"><img alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
 
 
520
  }
521
  }
522
  else{
523
- $html_thumb.= '<img alt="'.$alt_text.'" src="'.$thumb_url.'" />';
 
 
524
  }
525
  }
526
  else{
506
  $thumb_custom_url = isset($post_settings['thumb_custom_url']) ? $post_settings['thumb_custom_url'] : '';
507
 
508
 
509
+ // $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), $image_size );
510
+ // $alt_text = get_post_meta(get_post_thumbnail_id($post_id), '_wp_attachment_image_alt', true);
511
+ // $thumb_url = isset($thumb['0']) ? $thumb['0'] : '';
512
+ // $thumb_w = isset($thumb['1']) ? $thumb['1'] : '';
513
+ // $thumb_h = isset($thumb['2']) ? $thumb['2'] : '';
514
 
515
+
516
+ $post_thumbnail = get_the_post_thumbnail($post_id, $image_size);
517
+
518
+ //echo '<pre>'.var_export($image_size, true).'</pre>';
519
+
520
+
521
+ if(!empty($post_thumbnail)){
522
  if($link_to=='post_link'){
523
  if(!empty($thumb_custom_url)){
524
+ //$html_thumb.= '<a target="'.$link_target.'" href="'.$thumb_custom_url.'"><img width="'.$thumb_w.'" height="'.$thumb_h.'" alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
525
+ $html_thumb.= '<a target="'.$link_target.'" href="'.$thumb_custom_url.'">'.$post_thumbnail.'</a>';
526
+
527
  }
528
  else{
529
+ //$html_thumb.= '<a target="'.$link_target.'" href="'.$item_post_permalink.'"><img width="'.$thumb_w.'" height="'.$thumb_h.'"alt="'.$alt_text.'" src="'.$thumb_url.'" /></a>';
530
+ $html_thumb.= '<a target="'.$link_target.'" href="'.$item_post_permalink.'">'.$post_thumbnail.'</a>';
531
+
532
  }
533
  }
534
  else{
535
+ //$html_thumb.= '<img width="'.$thumb_w.'" height="'.$thumb_h.'" alt="'.$alt_text.'" src="'.$thumb_url.'" />';
536
+ $html_thumb.= $post_thumbnail;
537
+
538
  }
539
  }
540
  else{
post-grid.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Post Grid by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/
5
  Description: Awesome post grid for query post from any post type and display on grid.
6
- Version: 2.1.9
7
  Author: PickPlugins
8
  Author URI: https://www.pickplugins.com/
9
  License: GPLv2 or later
@@ -21,7 +21,7 @@ if( !class_exists( 'PostGrid' )){
21
  define('post_grid_plugin_dir', plugin_dir_path(__FILE__));
22
  define('post_grid_plugin_basename', plugin_basename(__FILE__));
23
  define('post_grid_plugin_name', 'Post Grid');
24
- define('post_grid_version', '2.1.9');
25
  define('post_grid_server_url', 'https://www.pickplugins.com/demo/post-grid/');
26
 
27
 
3
  Plugin Name: Post Grid by PickPlugins
4
  Plugin URI: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/
5
  Description: Awesome post grid for query post from any post type and display on grid.
6
+ Version: 2.1.10
7
  Author: PickPlugins
8
  Author URI: https://www.pickplugins.com/
9
  License: GPLv2 or later
21
  define('post_grid_plugin_dir', plugin_dir_path(__FILE__));
22
  define('post_grid_plugin_basename', plugin_basename(__FILE__));
23
  define('post_grid_plugin_name', 'Post Grid');
24
+ define('post_grid_version', '2.1.10');
25
  define('post_grid_server_url', 'https://www.pickplugins.com/demo/post-grid/');
26
 
27
 
readme.txt CHANGED
@@ -3,8 +3,8 @@
3
  Donate link: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/?ref=wordpress.org
4
  Tags: post grid, grid, custom post grid, post type grid, grid display, category filter, custom post, filter, filtering, grid, layout, list, masonry, post, post filter, post layout, taxonomy, taxonomy filter,
5
  Requires at least: 3.8
6
- Tested up to: 5.7
7
- Stable tag: 2.1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -222,6 +222,9 @@ then paste this shortcode anywhere in your page to display grid<br />
222
 
223
  == Changelog ==
224
 
 
 
 
225
  = 2.1.9 =
226
  * 2021-07-31 add - security on search result.
227
  * 2021-07-31 remove - remove ajax search result for fixing pagination issue.
3
  Donate link: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/?ref=wordpress.org
4
  Tags: post grid, grid, custom post grid, post type grid, grid display, category filter, custom post, filter, filtering, grid, layout, list, masonry, post, post filter, post layout, taxonomy, taxonomy filter,
5
  Requires at least: 3.8
6
+ Tested up to: 5.8
7
+ Stable tag: 2.1.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
222
 
223
  == Changelog ==
224
 
225
+ = 2.1.10 =
226
+ * 2021-07-31 add - featured image improved for responsive load.
227
+
228
  = 2.1.9 =
229
  * 2021-07-31 add - security on search result.
230
  * 2021-07-31 remove - remove ajax search result for fixing pagination issue.