Version Description
- 05/03/2015 add- Post link to title.
- 05/03/2015 add- Post link to thumbnail.
Download this release
Release Info
Developer | paratheme |
Plugin | Post Grid |
Version | 1.4 |
Comparing to | |
See all releases |
Code changes from version 1.3 to 1.4
- includes/PostGridClass.php +57 -0
- includes/post-grid-meta.php +10 -2
- post-grid.php +2 -2
- readme.txt +7 -2
- themes/flat/index.php +19 -3
- themes/flat/style.css +5 -0
- themes/rounded/index.php +18 -4
- themes/rounded/style.css +5 -0
includes/PostGridClass.php
CHANGED
@@ -55,6 +55,9 @@ class PostgridClass
|
|
55 |
$post_grid_wrapper = $this->settings_grid_get_post_meta($post->ID, 'post_grid_wrapper');
|
56 |
$post_grid_items_display = $this->settings_grid_get_post_meta($post->ID, 'post_grid_items_display');
|
57 |
$post_grid_post_meta_fields = $this->settings_grid_get_post_meta($post->ID, 'post_grid_post_meta_fields');
|
|
|
|
|
|
|
58 |
|
59 |
$html = '';
|
60 |
|
@@ -111,7 +114,61 @@ class PostgridClass
|
|
111 |
$html .= '<input style="width:80%" type="text" placeholder="post_view_count,post_share_count" name="post_grid_post_meta_fields['.$key.']" value="'.$post_grid_post_meta_fields.'" />';
|
112 |
$html .= '</div>';
|
113 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
|
117 |
$html .= '</div>';
|
55 |
$post_grid_wrapper = $this->settings_grid_get_post_meta($post->ID, 'post_grid_wrapper');
|
56 |
$post_grid_items_display = $this->settings_grid_get_post_meta($post->ID, 'post_grid_items_display');
|
57 |
$post_grid_post_meta_fields = $this->settings_grid_get_post_meta($post->ID, 'post_grid_post_meta_fields');
|
58 |
+
$post_grid_post_title_linked = $this->settings_grid_get_post_meta($post->ID, 'post_grid_post_title_linked');
|
59 |
+
$post_grid_post_thumbnail_linked = $this->settings_grid_get_post_meta($post->ID, 'post_grid_post_thumbnail_linked');
|
60 |
+
|
61 |
|
62 |
$html = '';
|
63 |
|
114 |
$html .= '<input style="width:80%" type="text" placeholder="post_view_count,post_share_count" name="post_grid_post_meta_fields['.$key.']" value="'.$post_grid_post_meta_fields.'" />';
|
115 |
$html .= '</div>';
|
116 |
}
|
117 |
+
|
118 |
+
elseif($key =='post_title')
|
119 |
+
{
|
120 |
+
$html .= '<div class="options-post_title"><br />';
|
121 |
+
$html .= 'Link to post ?<br />';
|
122 |
+
$html .= '<select name="post_grid_post_title_linked">';
|
123 |
+
|
124 |
+
$html .= '<option value="yes"';
|
125 |
+
if($post_grid_post_title_linked == 'yes')
|
126 |
+
{
|
127 |
+
$html .= 'selected';
|
128 |
+
}
|
129 |
+
$html .= '>Yes</option>';
|
130 |
+
|
131 |
+
$html .= '<option value="no"';
|
132 |
+
if($post_grid_post_title_linked == 'no')
|
133 |
+
{
|
134 |
+
$html .= 'selected';
|
135 |
+
}
|
136 |
+
$html .= '>No</option>';
|
137 |
+
|
138 |
+
$html .= '</select>';
|
139 |
+
|
140 |
+
$html .= '</div>';
|
141 |
+
}
|
142 |
+
elseif($key =='thumbnail')
|
143 |
+
{
|
144 |
+
$html .= '<div class="options-thumbnail"><br />';
|
145 |
+
$html .= 'Link to post ?<br />';
|
146 |
+
$html .= '<select name="post_grid_post_thumbnail_linked">';
|
147 |
+
|
148 |
+
$html .= '<option value="yes"';
|
149 |
+
if($post_grid_post_thumbnail_linked == 'yes')
|
150 |
+
{
|
151 |
+
$html .= 'selected';
|
152 |
+
}
|
153 |
+
$html .= '>Yes</option>';
|
154 |
+
|
155 |
+
$html .= '<option value="no"';
|
156 |
+
if($post_grid_post_thumbnail_linked == 'no')
|
157 |
+
{
|
158 |
+
$html .= 'selected';
|
159 |
+
}
|
160 |
+
$html .= '>No</option>';
|
161 |
+
|
162 |
+
$html .= '</select>';
|
163 |
|
164 |
+
$html .= '</div>';
|
165 |
+
}
|
166 |
+
|
167 |
+
else
|
168 |
+
{
|
169 |
+
$html .= '';
|
170 |
+
|
171 |
+
}
|
172 |
|
173 |
|
174 |
$html .= '</div>';
|
includes/post-grid-meta.php
CHANGED
@@ -95,7 +95,8 @@ function meta_boxes_post_grid_input( $post ) {
|
|
95 |
$post_grid_wrapper = get_post_meta( $post->ID, 'post_grid_wrapper', true );
|
96 |
$post_grid_items_display = get_post_meta( $post->ID, 'post_grid_items_display', true );
|
97 |
$post_grid_post_meta_fields = get_post_meta( $post->ID, 'post_grid_post_meta_fields', true );
|
98 |
-
|
|
|
99 |
?>
|
100 |
|
101 |
<div class="para-settings post-grid-settings">
|
@@ -658,7 +659,10 @@ function meta_boxes_post_grid_save( $post_id ) {
|
|
658 |
$post_grid_wrapper = stripslashes_deep( $_POST['post_grid_wrapper'] );
|
659 |
$post_grid_items_display = stripslashes_deep( $_POST['post_grid_items_display'] );
|
660 |
$post_grid_post_meta_fields = sanitize_text_field( $_POST['post_grid_post_meta_fields'] );
|
661 |
-
|
|
|
|
|
|
|
662 |
// Update the meta field in the database.
|
663 |
update_post_meta( $post_id, 'post_grid_post_per_page', $post_grid_post_per_page );
|
664 |
update_post_meta( $post_id, 'post_grid_themes', $post_grid_themes );
|
@@ -693,6 +697,10 @@ function meta_boxes_post_grid_save( $post_id ) {
|
|
693 |
update_post_meta( $post_id, 'post_grid_wrapper', $post_grid_wrapper );
|
694 |
update_post_meta( $post_id, 'post_grid_items_display', $post_grid_items_display );
|
695 |
update_post_meta( $post_id, 'post_grid_post_meta_fields', $post_grid_post_meta_fields );
|
|
|
|
|
|
|
|
|
696 |
}
|
697 |
add_action( 'save_post', 'meta_boxes_post_grid_save' );
|
698 |
|
95 |
$post_grid_wrapper = get_post_meta( $post->ID, 'post_grid_wrapper', true );
|
96 |
$post_grid_items_display = get_post_meta( $post->ID, 'post_grid_items_display', true );
|
97 |
$post_grid_post_meta_fields = get_post_meta( $post->ID, 'post_grid_post_meta_fields', true );
|
98 |
+
$post_grid_post_title_linked = get_post_meta( $post->ID, 'post_grid_post_title_linked', true );
|
99 |
+
$post_grid_post_thumbnail_linked = get_post_meta( $post->ID, 'post_grid_post_thumbnail_linked', true );
|
100 |
?>
|
101 |
|
102 |
<div class="para-settings post-grid-settings">
|
659 |
$post_grid_wrapper = stripslashes_deep( $_POST['post_grid_wrapper'] );
|
660 |
$post_grid_items_display = stripslashes_deep( $_POST['post_grid_items_display'] );
|
661 |
$post_grid_post_meta_fields = sanitize_text_field( $_POST['post_grid_post_meta_fields'] );
|
662 |
+
$post_grid_post_title_linked = sanitize_text_field( $_POST['post_grid_post_title_linked'] );
|
663 |
+
$post_grid_post_thumbnail_linked = sanitize_text_field( $_POST['post_grid_post_thumbnail_linked'] );
|
664 |
+
|
665 |
+
|
666 |
// Update the meta field in the database.
|
667 |
update_post_meta( $post_id, 'post_grid_post_per_page', $post_grid_post_per_page );
|
668 |
update_post_meta( $post_id, 'post_grid_themes', $post_grid_themes );
|
697 |
update_post_meta( $post_id, 'post_grid_wrapper', $post_grid_wrapper );
|
698 |
update_post_meta( $post_id, 'post_grid_items_display', $post_grid_items_display );
|
699 |
update_post_meta( $post_id, 'post_grid_post_meta_fields', $post_grid_post_meta_fields );
|
700 |
+
|
701 |
+
update_post_meta( $post_id, 'post_grid_post_title_linked', $post_grid_post_title_linked );
|
702 |
+
update_post_meta( $post_id, 'post_grid_post_thumbnail_linked', $post_grid_post_thumbnail_linked );
|
703 |
+
|
704 |
}
|
705 |
add_action( 'save_post', 'meta_boxes_post_grid_save' );
|
706 |
|
post-grid.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Post Grid
|
4 |
Plugin URI: http://paratheme.com
|
5 |
Description: Awesome post grid for query post from any post-type and display on grid.
|
6 |
-
Version: 1.
|
7 |
Author: paratheme
|
8 |
Author URI: http://paratheme.com
|
9 |
License: GPLv2 or later
|
@@ -97,7 +97,7 @@ register_activation_hook(__FILE__, 'post_grid_activation');
|
|
97 |
|
98 |
function post_grid_activation()
|
99 |
{
|
100 |
-
$post_grid_version= "1.
|
101 |
update_option('post_grid_version', $post_grid_version); //update plugin version.
|
102 |
|
103 |
$post_grid_customer_type= "free"; //customer_type "free"
|
3 |
Plugin Name: Post Grid
|
4 |
Plugin URI: http://paratheme.com
|
5 |
Description: Awesome post grid for query post from any post-type and display on grid.
|
6 |
+
Version: 1.4
|
7 |
Author: paratheme
|
8 |
Author URI: http://paratheme.com
|
9 |
License: GPLv2 or later
|
97 |
|
98 |
function post_grid_activation()
|
99 |
{
|
100 |
+
$post_grid_version= "1.4";
|
101 |
update_option('post_grid_version', $post_grid_version); //update plugin version.
|
102 |
|
103 |
$post_grid_customer_type= "free"; //customer_type "free"
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
Donate link: http://paratheme.com
|
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: 4.2
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -85,6 +85,11 @@ then paste this shortcode anywhere in your page to display grid<br />
|
|
85 |
== Changelog ==
|
86 |
|
87 |
|
|
|
|
|
|
|
|
|
|
|
88 |
= 1.3 =
|
89 |
* 05/03/2015 fix- pagination at home page issue fixed.
|
90 |
|
3 |
Donate link: http://paratheme.com
|
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: 4.2.1
|
7 |
+
Stable tag: 1.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
85 |
== Changelog ==
|
86 |
|
87 |
|
88 |
+
= 1.4 =
|
89 |
+
* 05/03/2015 add- Post link to title.
|
90 |
+
* 05/03/2015 add- Post link to thumbnail.
|
91 |
+
|
92 |
+
|
93 |
= 1.3 =
|
94 |
* 05/03/2015 fix- pagination at home page issue fixed.
|
95 |
|
themes/flat/index.php
CHANGED
@@ -38,6 +38,9 @@ function post_grid_themes_flat($post_id)
|
|
38 |
$post_grid_wrapper = get_post_meta( $post_id, 'post_grid_wrapper', true );
|
39 |
$post_grid_items_display = get_post_meta( $post_id, 'post_grid_items_display', true );
|
40 |
|
|
|
|
|
|
|
41 |
if(empty($post_grid_items))
|
42 |
{
|
43 |
$post_grid_items = array('post_title'=>'Title',
|
@@ -158,7 +161,14 @@ function post_grid_themes_flat($post_id)
|
|
158 |
$html .= '<div class="title">';
|
159 |
}
|
160 |
|
161 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
if(!empty($post_grid_wrapper[$key]['end']))
|
164 |
{
|
@@ -228,8 +238,14 @@ function post_grid_themes_flat($post_id)
|
|
228 |
$html .= '<div class="thumb" style="max-height:'.$post_grid_thumb_height.';" >';
|
229 |
}
|
230 |
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
|
234 |
if(!empty($post_grid_wrapper[$key]['end']))
|
235 |
{
|
38 |
$post_grid_wrapper = get_post_meta( $post_id, 'post_grid_wrapper', true );
|
39 |
$post_grid_items_display = get_post_meta( $post_id, 'post_grid_items_display', true );
|
40 |
|
41 |
+
$post_grid_post_title_linked = get_post_meta( $post_id, 'post_grid_post_title_linked', true );
|
42 |
+
$post_grid_post_thumbnail_linked = get_post_meta( $post_id, 'post_grid_post_thumbnail_linked', true );
|
43 |
+
|
44 |
if(empty($post_grid_items))
|
45 |
{
|
46 |
$post_grid_items = array('post_title'=>'Title',
|
161 |
$html .= '<div class="title">';
|
162 |
}
|
163 |
|
164 |
+
if($post_grid_post_title_linked == 'yes')
|
165 |
+
{
|
166 |
+
$html .= '<a href="'.get_the_permalink().'">'.get_the_title().'</a>';
|
167 |
+
}
|
168 |
+
else
|
169 |
+
{
|
170 |
+
$html .= get_the_title();
|
171 |
+
}
|
172 |
|
173 |
if(!empty($post_grid_wrapper[$key]['end']))
|
174 |
{
|
238 |
$html .= '<div class="thumb" style="max-height:'.$post_grid_thumb_height.';" >';
|
239 |
}
|
240 |
|
241 |
+
if($post_grid_post_thumbnail_linked == 'yes')
|
242 |
+
{
|
243 |
+
$html .= '<a href="'.get_the_permalink().'"><img src="'.$thumb_url.'" /></a>';
|
244 |
+
}
|
245 |
+
else
|
246 |
+
{
|
247 |
+
$html .= '<img src="'.$thumb_url.'" />';
|
248 |
+
}
|
249 |
|
250 |
if(!empty($post_grid_wrapper[$key]['end']))
|
251 |
{
|
themes/flat/style.css
CHANGED
@@ -36,6 +36,11 @@
|
|
36 |
padding: 10px;
|
37 |
text-align: left;
|
38 |
}
|
|
|
|
|
|
|
|
|
|
|
39 |
.post-grid-container.flat .meta {
|
40 |
padding: 10px;
|
41 |
}
|
36 |
padding: 10px;
|
37 |
text-align: left;
|
38 |
}
|
39 |
+
|
40 |
+
.post-grid-container.flat .title a {
|
41 |
+
text-decoration: none;
|
42 |
+
}
|
43 |
+
|
44 |
.post-grid-container.flat .meta {
|
45 |
padding: 10px;
|
46 |
}
|
themes/rounded/index.php
CHANGED
@@ -38,7 +38,8 @@ function post_grid_themes_rounded($post_id)
|
|
38 |
$post_grid_wrapper = get_post_meta( $post_id, 'post_grid_wrapper', true );
|
39 |
$post_grid_items_display = get_post_meta( $post_id, 'post_grid_items_display', true );
|
40 |
|
41 |
-
|
|
|
42 |
|
43 |
if(empty($post_grid_items))
|
44 |
{
|
@@ -158,7 +159,14 @@ function post_grid_themes_rounded($post_id)
|
|
158 |
$html .= '<div class="title">';
|
159 |
}
|
160 |
|
161 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
if(!empty($post_grid_wrapper[$key]['end']))
|
164 |
{
|
@@ -228,8 +236,14 @@ function post_grid_themes_rounded($post_id)
|
|
228 |
$html .= '<div class="thumb" style="height:'.$post_grid_items_width.';" >';
|
229 |
}
|
230 |
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
|
234 |
if(!empty($post_grid_wrapper[$key]['end']))
|
235 |
{
|
38 |
$post_grid_wrapper = get_post_meta( $post_id, 'post_grid_wrapper', true );
|
39 |
$post_grid_items_display = get_post_meta( $post_id, 'post_grid_items_display', true );
|
40 |
|
41 |
+
$post_grid_post_title_linked = get_post_meta( $post_id, 'post_grid_post_title_linked', true );
|
42 |
+
$post_grid_post_thumbnail_linked = get_post_meta( $post_id, 'post_grid_post_thumbnail_linked', true );
|
43 |
|
44 |
if(empty($post_grid_items))
|
45 |
{
|
159 |
$html .= '<div class="title">';
|
160 |
}
|
161 |
|
162 |
+
if($post_grid_post_title_linked == 'yes')
|
163 |
+
{
|
164 |
+
$html .= '<a href="'.get_the_permalink().'">'.get_the_title().'</a>';
|
165 |
+
}
|
166 |
+
else
|
167 |
+
{
|
168 |
+
$html .= get_the_title();
|
169 |
+
}
|
170 |
|
171 |
if(!empty($post_grid_wrapper[$key]['end']))
|
172 |
{
|
236 |
$html .= '<div class="thumb" style="height:'.$post_grid_items_width.';" >';
|
237 |
}
|
238 |
|
239 |
+
if($post_grid_post_thumbnail_linked == 'yes')
|
240 |
+
{
|
241 |
+
$html .= '<a href="'.get_the_permalink().'"><img src="'.$thumb_url.'" /></a>';
|
242 |
+
}
|
243 |
+
else
|
244 |
+
{
|
245 |
+
$html .= '<img src="'.$thumb_url.'" />';
|
246 |
+
}
|
247 |
|
248 |
if(!empty($post_grid_wrapper[$key]['end']))
|
249 |
{
|
themes/rounded/style.css
CHANGED
@@ -38,6 +38,11 @@
|
|
38 |
text-align: left;
|
39 |
}
|
40 |
|
|
|
|
|
|
|
|
|
|
|
41 |
.post-grid-container.rounded .content {
|
42 |
font-size: 13px;
|
43 |
line-height: inherit;
|
38 |
text-align: left;
|
39 |
}
|
40 |
|
41 |
+
.post-grid-container.rounded .title a {
|
42 |
+
text-decoration: none;
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
.post-grid-container.rounded .content {
|
47 |
font-size: 13px;
|
48 |
line-height: inherit;
|