Post Grid - Version 1.2

Version Description

  • 05/03/2015 remove- removed some options.
    • 05/03/2015 add- grid layout builder.
Download this release

Release Info

Developer paratheme
Plugin Icon 128x128 Post Grid
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

ParaAdmin/ParaAdminClass.php ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // ParaAdmin Class
4
+
5
+ class paraAdmin
6
+ {
7
+ var $options = array();
8
+
9
+
10
+ function option_output($options_all, $options_tabs)
11
+ {
12
+ $html = '';
13
+ $html .= '<div class="para-settings">';
14
+
15
+ $html .= '<ul class="tab-nav">';
16
+
17
+ $i=1;
18
+ foreach($options_tabs as $id => $tabs)
19
+ {
20
+ if($i==1)
21
+ {
22
+ $active = 'active';
23
+ }
24
+ else
25
+ {
26
+ $active = '';
27
+ }
28
+
29
+ $html.= '<li nav="'.$i.'" class="tab'.$i.' '.$active.' ">'.$tabs.'</li>';
30
+
31
+ $i++;
32
+ }
33
+ $html .= '</ul>';
34
+
35
+
36
+
37
+ $html .= '<ul class="box">';
38
+
39
+ $j = 1;
40
+ foreach($options_tabs as $id => $tabs)
41
+ {
42
+ if($j==1)
43
+ {
44
+ $active = 'active';
45
+ $display = 'block';
46
+ }
47
+ else
48
+ {
49
+ $active = '';
50
+ $display = 'none';
51
+ }
52
+ $html.= '<li style="display: '.$display.';" class="box'.$j.' tab-box '.$active.'">';
53
+ foreach($options_all[$id] as $id => $options)
54
+ {
55
+ foreach($options as $option)
56
+
57
+ $css_class = $options['css_class'];
58
+ $title = $options['title'];
59
+ $option_details = $options['option_details'];
60
+ $input_type = $options['input_type'];
61
+ $input_values = $options['input_values'];
62
+
63
+ $html.= '<div class="option-box">';
64
+
65
+ $html.= '<p class="option-title">'.$title.'</p>';
66
+ $html.= '<p class="option-info">'.$option_details.'</p>';
67
+
68
+ $html.= $this->input_type($input_type, $input_values, $id, $css_class);
69
+
70
+ $html.= '</div>';
71
+
72
+ }
73
+ $html.= '</li>';
74
+
75
+ $j++;
76
+ }
77
+ $html .= '</ul>';
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+ $html .= '</div>';
87
+
88
+
89
+ return $html;
90
+
91
+ }
92
+
93
+
94
+ function input_type($input_type, $input_values, $id, $css_class)
95
+ {
96
+
97
+
98
+
99
+ $html ='';
100
+ if($input_type == 'text')
101
+ {
102
+
103
+ $option_id_value = get_option( $id );
104
+ if(empty($option_id_value))
105
+ {
106
+ $option_id_value = '';
107
+ }
108
+
109
+
110
+
111
+ $html.= '<input name="'.$id.'" type="text" value="'.$option_id_value.'" id="'.$id.'" class="'.$css_class.'" />';
112
+ }
113
+
114
+ elseif($input_type == 'textarea')
115
+ {
116
+
117
+ $option_id_value = get_option( $id );
118
+
119
+ if(!empty($option_id_value))
120
+ {
121
+ $value = $option_id_value;
122
+ }
123
+ else
124
+ {
125
+ $value = $input_values;
126
+ }
127
+
128
+
129
+
130
+ $html.= '<textarea name="'.$id.'" type="text" id="'.$id.'" class="'.$css_class.'" >'.$value.'</textarea>';
131
+ }
132
+
133
+
134
+
135
+
136
+
137
+ elseif($input_type == 'checkbox')
138
+ {
139
+
140
+ foreach($input_values as $key => $value)
141
+ {
142
+
143
+
144
+
145
+ $option_key_value = get_option( $key );
146
+ if(empty($option_key_value))
147
+ {
148
+ $option_key_value = '';
149
+ $checked = '';
150
+ }
151
+ else
152
+ {
153
+ $checked = 'checked';
154
+ }
155
+
156
+
157
+
158
+ $html.= '<label>';
159
+
160
+ $html.= '<input name="'.$key.'" type="checkbox" '.$checked.' value="1" id="'.$key.'" class="'.$css_class.'" /> '.$value;
161
+ $html.= '</label><br />';
162
+ }
163
+
164
+
165
+ }
166
+
167
+ elseif($input_type == 'select')
168
+ {
169
+
170
+
171
+ $html.= '<select name="'.$id.'" id="'.$id.'" class="'.$css_class.'">';
172
+ foreach($input_values as $key => $value)
173
+ {
174
+
175
+
176
+ $option_id_value = get_option( $id );
177
+ if($option_id_value == $key )
178
+ {
179
+ $selected = 'selected';
180
+
181
+ }
182
+ else
183
+ {
184
+ $selected = '';
185
+ }
186
+
187
+
188
+
189
+ $html.= '<option '.$selected.' value="'.$key.'" >'.$value.'</option>';
190
+ }
191
+ $html.= '</select>';
192
+
193
+ }
194
+
195
+
196
+ elseif($input_type == 'radio')
197
+ {
198
+
199
+ foreach($input_values as $key => $value)
200
+ {
201
+ $html.= '<label>';
202
+
203
+ $option_id_value = get_option( $id );
204
+ if($option_id_value == $key )
205
+ {
206
+ $checked = 'checked';
207
+
208
+ }
209
+ else
210
+ {
211
+ $checked = '';
212
+ }
213
+
214
+
215
+
216
+
217
+ $html.= '<input '.$checked.' class="'.$css_class.'" id="'.$key.'" type="radio" name="'.$id.'" value="'.$key.'" >'.$value.'</option> ';
218
+ $html.= '</label><br />';
219
+ }
220
+
221
+
222
+ }
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+ return $html;
231
+ }
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+ }
244
+
245
+
ParaAdmin/css/ParaAdmin.css CHANGED
@@ -77,19 +77,6 @@
77
 
78
 
79
 
80
- .para-settings ul.voting-bg-img-list{}
81
-
82
- .para-settings ul.voting-bg-img-list li {
83
- display: inline-block;
84
- margin: 5px;
85
- }
86
- .para-settings ul.voting-bg-img-list li.bg-selected {}
87
-
88
- .para-settings ul.voting-bg-img-list li img{border: 2px solid #ffffff;}
89
-
90
- .para-settings ul.voting-bg-img-list li.bg-selected img{
91
- border: 2px solid #ff5a11;
92
- }
93
 
94
 
95
  .para-settings h2 {
@@ -98,47 +85,6 @@
98
  margin: 25px 0;
99
  }
100
 
101
- .para-settings .pricing-table{
102
-
103
- }
104
-
105
- .para-settings .pricing-table .column {
106
- border-bottom: 1px solid #ff9601;
107
- border-left: 1px solid #ff9601;
108
- border-top: 1px solid #ff9601;
109
- display: inline-block;
110
- float: left;
111
- text-align: center;
112
- vertical-align: top;
113
- width: 48%;
114
- }
115
-
116
- .para-settings .pricing-table .column:last-child {
117
- border-right: 1px solid #ff9601;
118
- }
119
-
120
- .para-settings .paln {
121
-
122
- border-bottom: 1px solid rgb(255, 150, 1);
123
- display: block;
124
- font-size: 20px;
125
- font-weight: bold;
126
- line-height: 30px;
127
- padding: 10px 0;
128
- }
129
- .para-settings .cell {
130
- border-bottom: 1px solid rgb(255, 150, 1);
131
- display: block;
132
- line-height: 20px;
133
- padding: 7px 0;
134
- }
135
-
136
- .para-settings .hidden-mob {
137
-
138
- display: none;
139
-
140
- }
141
-
142
 
143
 
144
  .para-settings .green {
@@ -157,27 +103,6 @@
157
 
158
  }
159
 
160
- .para-settings .price {
161
- font-size: 18px;
162
- font-weight: bold;
163
- padding: 25px 0;
164
- border-bottom: 1px solid rgb(255, 150, 1);
165
- }
166
-
167
-
168
- .para-settings .buy-now {
169
- background: none repeat scroll 0 0 rgb(221, 221, 221);
170
- border-bottom: 2px solid rgb(157, 157, 157);
171
- border-radius: 12px;
172
- padding: 2px 12px;
173
- text-decoration: none;
174
- }
175
-
176
- .para-settings .buy-now:hover {
177
-
178
- border-bottom: 2px solid #706f6f;
179
-
180
- }
181
 
182
 
183
 
@@ -242,6 +167,77 @@
242
  }
243
 
244
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
 
246
  /*para-dashboard*/
247
 
77
 
78
 
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
 
82
  .para-settings h2 {
85
  margin: 25px 0;
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
 
90
  .para-settings .green {
103
 
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
 
108
 
167
  }
168
 
169
 
170
+ input.switch:empty
171
+ {
172
+ margin-left: -999px;
173
+ }
174
+ input.switch:empty ~ label
175
+ {
176
+ position: relative;
177
+ float: left;
178
+ line-height: 1.6em;
179
+ text-indent: 4em;
180
+ margin: 0.2em 0;
181
+ cursor: pointer;
182
+ -webkit-user-select: none;
183
+ -moz-user-select: none;
184
+ -ms-user-select: none;
185
+ user-select: none;
186
+ }
187
+
188
+ input.switch:empty ~ label:before,
189
+ input.switch:empty ~ label:after
190
+ {
191
+ position: absolute;
192
+ display: block;
193
+ top: 0;
194
+ bottom: 0;
195
+ left: 0;
196
+ content: ' ';
197
+ width: 3.6em;
198
+ background-color: #e4e4e4;
199
+ border-radius: 0.3em;
200
+ box-shadow: inset 0 0.2em 0 rgba(0,0,0,0.3);
201
+ -webkit-transition: all 100ms ease-in;
202
+ transition: all 100ms ease-in;
203
+ }
204
+
205
+ input.switch:empty ~ label:after
206
+ {
207
+ width: 1.4em;
208
+ top: 0.1em;
209
+ bottom: 0.1em;
210
+ margin-left: 0.1em;
211
+ background-color: #fff;
212
+ border-radius: 0.15em;
213
+ box-shadow: inset 0 -0.2em 0 rgba(0,0,0,0.2);
214
+ }
215
+
216
+
217
+ input.switch:checked ~ label:before
218
+ {
219
+ background-color: #69c8ff;
220
+ }
221
+
222
+ input.switch:checked ~ label:after
223
+ {
224
+ margin-left: 2em;
225
+ }
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
 
242
  /*para-dashboard*/
243
 
ParaAdmin/css/icons/dark/browser-firefox.png ADDED
Binary file
ParaAdmin/css/icons/dark/device-monitor.png ADDED
Binary file
ParaAdmin/css/icons/dark/globe.png ADDED
Binary file
ParaAdmin/css/icons/dark/keywords.png ADDED
Binary file
ParaAdmin/css/icons/dark/map-pin.png ADDED
Binary file
ParaAdmin/css/icons/dark/os-apple.png ADDED
Binary file
ParaAdmin/css/icons/dark/os-windows.png ADDED
Binary file
ParaAdmin/css/icons/dark/page.png ADDED
Binary file
ParaAdmin/css/icons/dark/share-hub.png ADDED
Binary file
ParaAdmin/css/icons/dark/user-crowd.png ADDED
Binary file
ParaAdmin/css/icons/dark/user-group.png ADDED
Binary file
admin/css/style.css ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Admin css
3
+ */
4
+
5
+
6
+ .post-grid-settings{}
7
+
8
+
9
+ .post-grid-settings ul.post_grid_bg_img_list{}
10
+
11
+ .post-grid-settings ul.post_grid_bg_img_list li {
12
+ display: inline-block;
13
+ margin: 5px;
14
+ }
15
+ .post-grid-settings ul.post_grid_bg_img_list li.bg-selected {}
16
+
17
+ .post-grid-settings ul.post_grid_bg_img_list li img{border: 2px solid #ffffff;}
18
+
19
+ .post-grid-settings ul.post_grid_bg_img_list li.bg-selected img{
20
+ border: 2px solid #ff5a11;
21
+ }
22
+
23
+
24
+ .post-grid-settings .post_grid_loading_taxonomy_category {
25
+ background:url("../../css/loading.gif") repeat scroll 0 0 rgba(0, 0, 0, 0);
26
+ height: 11px;
27
+ width: 30px;
28
+ }
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+ .post-grid-settings .post-grid-builder {
41
+ margin-bottom: 20px;
42
+ }
43
+ .post-grid-settings .post-grid-builder .items {
44
+ background: none repeat scroll 0 0 rgb(230, 230, 230);
45
+ border: 1px solid rgb(153, 153, 153);
46
+ min-height: 50px;
47
+ padding: 5px;
48
+ }
49
+
50
+ .post-grid-settings .post-grid-builder .item {
51
+ background: none repeat scroll 0 0 rgb(255, 255, 255);
52
+ border-bottom: 1px solid rgb(153, 153, 153);
53
+ cursor: move;
54
+ display: inline-block;
55
+ margin: 2px;
56
+ padding: 5px 10px;
57
+ }
58
+ .post-grid-settings .post-grid-builder .item.active{
59
+ background: none repeat scroll 0 0 rgb(221, 240, 255);
60
+ }
61
+ .post-grid-settings .post-grid-builder .item.active .options {
62
+ display:block;
63
+ }
64
+
65
+ .post-grid-settings .post-grid-builder .item.ui-draggable-dragging {
66
+ border:1px dashed #999;
67
+ }
68
+
69
+
70
+ .post-grid-settings .post-grid-builder .item .options {
71
+ display:none;
72
+ }
73
+
74
+
75
+
76
+
77
+ .post-grid-settings .post-grid-builder .canvas {
78
+ background: none repeat scroll 0 0 rgb(230, 230, 230);
79
+ border: 1px solid rgb(153, 153, 153);
80
+ margin: 20px 0;
81
+ min-height: 100px;
82
+ padding: 10px 10px 50px;
83
+ }
84
+
85
+ .post-grid-settings .post-grid-builder .canvas .saved-item {
86
+ background: none repeat scroll 0 0 rgb(255, 255, 255);
87
+ border-bottom: 1px solid rgb(153, 153, 153);
88
+ display: block;
89
+ margin: 2px;
90
+ padding: 5px 10px;
91
+ position: relative;
92
+ }
93
+
94
+
95
+ .post-grid-settings .post-grid-builder .canvas .ui-sortable-helper{
96
+ border:1px dashed #999;
97
+
98
+ }
99
+
100
+
101
+ .post-grid-settings .post-grid-builder .canvas .saved-item.active {
102
+
103
+ padding: 0;
104
+ }
105
+
106
+ .post-grid-settings .post-grid-builder .canvas .saved-item.active .header {
107
+ border-bottom: 1px solid rgb(153, 153, 153);
108
+ margin-bottom: 15px;
109
+ padding: 7px 10px;
110
+ }
111
+ .post-grid-settings .post-grid-builder .canvas .saved-item .options {
112
+ display:none;
113
+
114
+ }
115
+ .post-grid-settings .post-grid-builder .canvas .saved-item.active .options {
116
+ display:block;
117
+ padding: 7px 10px;
118
+ }
119
+
120
+ .post-grid-settings .post-grid-builder .canvas .saved-item .remove {
121
+ background: none repeat scroll 0 0 rgb(255, 137, 65);
122
+ cursor: pointer;
123
+ display: inline-block;
124
+ float: right;
125
+ padding: 0 5px;
126
+ position: relative;
127
+ }
128
+
129
+ .post-grid-settings #post-grid-builder {
130
+ width: 100%;
131
+ }
132
+
133
+
134
+ .post-grid-settings #post-grid-builder tr {
135
+ background: none repeat scroll 0 0 rgb(255, 255, 255);
136
+ border-bottom: 1px solid rgb(153, 153, 153);
137
+ padding: 0;
138
+ }
139
+
140
+ .post-grid-settings #post-grid-builder td {
141
+
142
+ }
143
+
144
+ .post-grid-settings #post-grid-builder td.dragHandle {
145
+ text-align: center;
146
+ width: 25px;
147
+ }
148
+
149
+
150
+
151
+ .post-grid-settings #post-grid-builder .header {
152
+ border-bottom: 1px solid rgb(153, 153, 153);
153
+ padding: 5px 10px;
154
+ }
155
+
156
+ .post-grid-settings #post-grid-builder .options {
157
+ display: none;
158
+ }
159
+ .post-grid-settings #post-grid-builder tr.active{
160
+ background: none repeat scroll 0 0 rgb(221, 240, 255);
161
+ }
162
+
163
+ .post-grid-settings #post-grid-builder tr.active .header {
164
+ background: none repeat scroll 0 0 rgb(172, 218, 253);
165
+ }
166
+ .post-grid-settings #post-grid-builder tr.active .options {
167
+ display: block;
168
+ padding: 5px 10px;
169
+ }
170
+
171
+ .post-grid-settings .input-switch {
172
+ display: inline-block;
173
+ float: right;
174
+ margin-left: 10px;
175
+ margin-right: 43px;
176
+ position: absolute;
177
+ right: 23px;
178
+ top: 0;
179
+ vertical-align: top;
180
+ width: 14px;
181
+ }
admin/js/color-picker.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($)
2
+ {
3
+
4
+
5
+ //$('').wpColorPicker();
6
+
7
+
8
+
9
+
10
+ });
admin/js/hs.png ADDED
Binary file
admin/js/hv.png ADDED
Binary file
admin/js/jscolor.js ADDED
@@ -0,0 +1,997 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jscolor, JavaScript Color Picker
3
+ *
4
+ * @version 1.4.3
5
+ * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
6
+ * @author Jan Odvarko, http://odvarko.cz
7
+ * @created 2008-06-15
8
+ * @updated 2014-07-16
9
+ * @link http://jscolor.com
10
+ */
11
+
12
+
13
+ var jscolor = {
14
+
15
+
16
+ dir : '', // location of jscolor directory (leave empty to autodetect)
17
+ bindClass : 'color', // class name
18
+ binding : true, // automatic binding via <input class="...">
19
+ preloading : true, // use image preloading?
20
+
21
+
22
+ install : function() {
23
+ jscolor.addEvent(window, 'load', jscolor.init);
24
+ },
25
+
26
+
27
+ init : function() {
28
+ if(jscolor.binding) {
29
+ jscolor.bind();
30
+ }
31
+ if(jscolor.preloading) {
32
+ jscolor.preload();
33
+ }
34
+ },
35
+
36
+
37
+ getDir : function() {
38
+ if(!jscolor.dir) {
39
+ var detected = jscolor.detectDir();
40
+ jscolor.dir = detected!==false ? detected : 'jscolor/';
41
+ }
42
+ return jscolor.dir;
43
+ },
44
+
45
+
46
+ detectDir : function() {
47
+ var base = location.href;
48
+
49
+ var e = document.getElementsByTagName('base');
50
+ for(var i=0; i<e.length; i+=1) {
51
+ if(e[i].href) { base = e[i].href; }
52
+ }
53
+
54
+ var e = document.getElementsByTagName('script');
55
+ for(var i=0; i<e.length; i+=1) {
56
+ if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
57
+ var src = new jscolor.URI(e[i].src);
58
+ var srcAbs = src.toAbsolute(base);
59
+ srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
60
+ srcAbs.query = null;
61
+ srcAbs.fragment = null;
62
+ return srcAbs.toString();
63
+ }
64
+ }
65
+ return false;
66
+ },
67
+
68
+
69
+ bind : function() {
70
+ var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
71
+ var e = document.getElementsByTagName('input');
72
+ for(var i=0; i<e.length; i+=1) {
73
+ var m;
74
+ if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
75
+ var prop = {};
76
+ if(m[4]) {
77
+ try {
78
+ prop = (new Function ('return (' + m[4] + ')'))();
79
+ } catch(eInvalidProp) {}
80
+ }
81
+ e[i].color = new jscolor.color(e[i], prop);
82
+ }
83
+ }
84
+ },
85
+
86
+
87
+ preload : function() {
88
+ for(var fn in jscolor.imgRequire) {
89
+ if(jscolor.imgRequire.hasOwnProperty(fn)) {
90
+ jscolor.loadImage(fn);
91
+ }
92
+ }
93
+ },
94
+
95
+
96
+ images : {
97
+ pad : [ 181, 101 ],
98
+ sld : [ 16, 101 ],
99
+ cross : [ 15, 15 ],
100
+ arrow : [ 7, 11 ]
101
+ },
102
+
103
+
104
+ imgRequire : {},
105
+ imgLoaded : {},
106
+
107
+
108
+ requireImage : function(filename) {
109
+ jscolor.imgRequire[filename] = true;
110
+ },
111
+
112
+
113
+ loadImage : function(filename) {
114
+ if(!jscolor.imgLoaded[filename]) {
115
+ jscolor.imgLoaded[filename] = new Image();
116
+ jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
117
+ }
118
+ },
119
+
120
+
121
+ fetchElement : function(mixed) {
122
+ return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
123
+ },
124
+
125
+
126
+ addEvent : function(el, evnt, func) {
127
+ if(el.addEventListener) {
128
+ el.addEventListener(evnt, func, false);
129
+ } else if(el.attachEvent) {
130
+ el.attachEvent('on'+evnt, func);
131
+ }
132
+ },
133
+
134
+
135
+ fireEvent : function(el, evnt) {
136
+ if(!el) {
137
+ return;
138
+ }
139
+ if(document.createEvent) {
140
+ var ev = document.createEvent('HTMLEvents');
141
+ ev.initEvent(evnt, true, true);
142
+ el.dispatchEvent(ev);
143
+ } else if(document.createEventObject) {
144
+ var ev = document.createEventObject();
145
+ el.fireEvent('on'+evnt, ev);
146
+ } else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
147
+ el['on'+evnt]();
148
+ }
149
+ },
150
+
151
+
152
+ getElementPos : function(e) {
153
+ var e1=e, e2=e;
154
+ var x=0, y=0;
155
+ if(e1.offsetParent) {
156
+ do {
157
+ x += e1.offsetLeft;
158
+ y += e1.offsetTop;
159
+ } while(e1 = e1.offsetParent);
160
+ }
161
+ while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
162
+ x -= e2.scrollLeft;
163
+ y -= e2.scrollTop;
164
+ }
165
+ return [x, y];
166
+ },
167
+
168
+
169
+ getElementSize : function(e) {
170
+ return [e.offsetWidth, e.offsetHeight];
171
+ },
172
+
173
+
174
+ getRelMousePos : function(e) {
175
+ var x = 0, y = 0;
176
+ if (!e) { e = window.event; }
177
+ if (typeof e.offsetX === 'number') {
178
+ x = e.offsetX;
179
+ y = e.offsetY;
180
+ } else if (typeof e.layerX === 'number') {
181
+ x = e.layerX;
182
+ y = e.layerY;
183
+ }
184
+ return { x: x, y: y };
185
+ },
186
+
187
+
188
+ getViewPos : function() {
189
+ if(typeof window.pageYOffset === 'number') {
190
+ return [window.pageXOffset, window.pageYOffset];
191
+ } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
192
+ return [document.body.scrollLeft, document.body.scrollTop];
193
+ } else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
194
+ return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
195
+ } else {
196
+ return [0, 0];
197
+ }
198
+ },
199
+
200
+
201
+ getViewSize : function() {
202
+ if(typeof window.innerWidth === 'number') {
203
+ return [window.innerWidth, window.innerHeight];
204
+ } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
205
+ return [document.body.clientWidth, document.body.clientHeight];
206
+ } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
207
+ return [document.documentElement.clientWidth, document.documentElement.clientHeight];
208
+ } else {
209
+ return [0, 0];
210
+ }
211
+ },
212
+
213
+
214
+ URI : function(uri) { // See RFC3986
215
+
216
+ this.scheme = null;
217
+ this.authority = null;
218
+ this.path = '';
219
+ this.query = null;
220
+ this.fragment = null;
221
+
222
+ this.parse = function(uri) {
223
+ var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
224
+ this.scheme = m[3] ? m[2] : null;
225
+ this.authority = m[5] ? m[6] : null;
226
+ this.path = m[7];
227
+ this.query = m[9] ? m[10] : null;
228
+ this.fragment = m[12] ? m[13] : null;
229
+ return this;
230
+ };
231
+
232
+ this.toString = function() {
233
+ var result = '';
234
+ if(this.scheme !== null) { result = result + this.scheme + ':'; }
235
+ if(this.authority !== null) { result = result + '//' + this.authority; }
236
+ if(this.path !== null) { result = result + this.path; }
237
+ if(this.query !== null) { result = result + '?' + this.query; }
238
+ if(this.fragment !== null) { result = result + '#' + this.fragment; }
239
+ return result;
240
+ };
241
+
242
+ this.toAbsolute = function(base) {
243
+ var base = new jscolor.URI(base);
244
+ var r = this;
245
+ var t = new jscolor.URI;
246
+
247
+ if(base.scheme === null) { return false; }
248
+
249
+ if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
250
+ r.scheme = null;
251
+ }
252
+
253
+ if(r.scheme !== null) {
254
+ t.scheme = r.scheme;
255
+ t.authority = r.authority;
256
+ t.path = removeDotSegments(r.path);
257
+ t.query = r.query;
258
+ } else {
259
+ if(r.authority !== null) {
260
+ t.authority = r.authority;
261
+ t.path = removeDotSegments(r.path);
262
+ t.query = r.query;
263
+ } else {
264
+ if(r.path === '') {
265
+ t.path = base.path;
266
+ if(r.query !== null) {
267
+ t.query = r.query;
268
+ } else {
269
+ t.query = base.query;
270
+ }
271
+ } else {
272
+ if(r.path.substr(0,1) === '/') {
273
+ t.path = removeDotSegments(r.path);
274
+ } else {
275
+ if(base.authority !== null && base.path === '') {
276
+ t.path = '/'+r.path;
277
+ } else {
278
+ t.path = base.path.replace(/[^\/]+$/,'')+r.path;
279
+ }
280
+ t.path = removeDotSegments(t.path);
281
+ }
282
+ t.query = r.query;
283
+ }
284
+ t.authority = base.authority;
285
+ }
286
+ t.scheme = base.scheme;
287
+ }
288
+ t.fragment = r.fragment;
289
+
290
+ return t;
291
+ };
292
+
293
+ function removeDotSegments(path) {
294
+ var out = '';
295
+ while(path) {
296
+ if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
297
+ path = path.replace(/^\.+/,'').substr(1);
298
+ } else if(path.substr(0,3)==='/./' || path==='/.') {
299
+ path = '/'+path.substr(3);
300
+ } else if(path.substr(0,4)==='/../' || path==='/..') {
301
+ path = '/'+path.substr(4);
302
+ out = out.replace(/\/?[^\/]*$/, '');
303
+ } else if(path==='.' || path==='..') {
304
+ path = '';
305
+ } else {
306
+ var rm = path.match(/^\/?[^\/]*/)[0];
307
+ path = path.substr(rm.length);
308
+ out = out + rm;
309
+ }
310
+ }
311
+ return out;
312
+ }
313
+
314
+ if(uri) {
315
+ this.parse(uri);
316
+ }
317
+
318
+ },
319
+
320
+
321
+ //
322
+ // Usage example:
323
+ // var myColor = new jscolor.color(myInputElement)
324
+ //
325
+
326
+ color : function(target, prop) {
327
+
328
+
329
+ this.required = true; // refuse empty values?
330
+ this.adjust = true; // adjust value to uniform notation?
331
+ this.hash = false; // prefix color with # symbol?
332
+ this.caps = true; // uppercase?
333
+ this.slider = true; // show the value/saturation slider?
334
+ this.valueElement = target; // value holder
335
+ this.styleElement = target; // where to reflect current color
336
+ this.onImmediateChange = null; // onchange callback (can be either string or function)
337
+ this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
338
+ this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
339
+ this.minH = 0; // read-only 0-6
340
+ this.maxH = 6; // read-only 0-6
341
+ this.minS = 0; // read-only 0-1
342
+ this.maxS = 1; // read-only 0-1
343
+ this.minV = 0; // read-only 0-1
344
+ this.maxV = 1; // read-only 0-1
345
+
346
+ this.pickerOnfocus = true; // display picker on focus?
347
+ this.pickerMode = 'HSV'; // HSV | HVS
348
+ this.pickerPosition = 'bottom'; // left | right | top | bottom
349
+ this.pickerSmartPosition = true; // automatically adjust picker position when necessary
350
+ this.pickerButtonHeight = 20; // px
351
+ this.pickerClosable = false;
352
+ this.pickerCloseText = 'Close';
353
+ this.pickerButtonColor = 'ButtonText'; // px
354
+ this.pickerFace = 10; // px
355
+ this.pickerFaceColor = 'ThreeDFace'; // CSS color
356
+ this.pickerBorder = 1; // px
357
+ this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
358
+ this.pickerInset = 1; // px
359
+ this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
360
+ this.pickerZIndex = 10000;
361
+
362
+
363
+ for(var p in prop) {
364
+ if(prop.hasOwnProperty(p)) {
365
+ this[p] = prop[p];
366
+ }
367
+ }
368
+
369
+
370
+ this.hidePicker = function() {
371
+ if(isPickerOwner()) {
372
+ removePicker();
373
+ }
374
+ };
375
+
376
+
377
+ this.showPicker = function() {
378
+ if(!isPickerOwner()) {
379
+ var tp = jscolor.getElementPos(target); // target pos
380
+ var ts = jscolor.getElementSize(target); // target size
381
+ var vp = jscolor.getViewPos(); // view pos
382
+ var vs = jscolor.getViewSize(); // view size
383
+ var ps = getPickerDims(this); // picker size
384
+ var a, b, c;
385
+ switch(this.pickerPosition.toLowerCase()) {
386
+ case 'left': a=1; b=0; c=-1; break;
387
+ case 'right':a=1; b=0; c=1; break;
388
+ case 'top': a=0; b=1; c=-1; break;
389
+ default: a=0; b=1; c=1; break;
390
+ }
391
+ var l = (ts[b]+ps[b])/2;
392
+
393
+ // picker pos
394
+ if (!this.pickerSmartPosition) {
395
+ var pp = [
396
+ tp[a],
397
+ tp[b]+ts[b]-l+l*c
398
+ ];
399
+ } else {
400
+ var pp = [
401
+ -vp[a]+tp[a]+ps[a] > vs[a] ?
402
+ (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
403
+ tp[a],
404
+ -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
405
+ (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
406
+ (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
407
+ ];
408
+ }
409
+ drawPicker(pp[a], pp[b]);
410
+ }
411
+ };
412
+
413
+
414
+ this.importColor = function() {
415
+ if(!valueElement) {
416
+ this.exportColor();
417
+ } else {
418
+ if(!this.adjust) {
419
+ if(!this.fromString(valueElement.value, leaveValue)) {
420
+ styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
421
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
422
+ styleElement.style.color = styleElement.jscStyle.color;
423
+ this.exportColor(leaveValue | leaveStyle);
424
+ }
425
+ } else if(!this.required && /^\s*$/.test(valueElement.value)) {
426
+ valueElement.value = '';
427
+ styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
428
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
429
+ styleElement.style.color = styleElement.jscStyle.color;
430
+ this.exportColor(leaveValue | leaveStyle);
431
+
432
+ } else if(this.fromString(valueElement.value)) {
433
+ // OK
434
+ } else {
435
+ this.exportColor();
436
+ }
437
+ }
438
+ };
439
+
440
+
441
+ this.exportColor = function(flags) {
442
+ if(!(flags & leaveValue) && valueElement) {
443
+ var value = this.toString();
444
+ if(this.caps) { value = value.toUpperCase(); }
445
+ if(this.hash) { value = '#'+value; }
446
+ valueElement.value = value;
447
+ }
448
+ if(!(flags & leaveStyle) && styleElement) {
449
+ styleElement.style.backgroundImage = "none";
450
+ styleElement.style.backgroundColor =
451
+ '#'+this.toString();
452
+ styleElement.style.color =
453
+ 0.213 * this.rgb[0] +
454
+ 0.715 * this.rgb[1] +
455
+ 0.072 * this.rgb[2]
456
+ < 0.5 ? '#FFF' : '#000';
457
+ }
458
+ if(!(flags & leavePad) && isPickerOwner()) {
459
+ redrawPad();
460
+ }
461
+ if(!(flags & leaveSld) && isPickerOwner()) {
462
+ redrawSld();
463
+ }
464
+ };
465
+
466
+
467
+ this.fromHSV = function(h, s, v, flags) { // null = don't change
468
+ if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); }
469
+ if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
470
+ if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
471
+
472
+ this.rgb = HSV_RGB(
473
+ h===null ? this.hsv[0] : (this.hsv[0]=h),
474
+ s===null ? this.hsv[1] : (this.hsv[1]=s),
475
+ v===null ? this.hsv[2] : (this.hsv[2]=v)
476
+ );
477
+
478
+ this.exportColor(flags);
479
+ };
480
+
481
+
482
+ this.fromRGB = function(r, g, b, flags) { // null = don't change
483
+ if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); }
484
+ if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); }
485
+ if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); }
486
+
487
+ var hsv = RGB_HSV(
488
+ r===null ? this.rgb[0] : r,
489
+ g===null ? this.rgb[1] : g,
490
+ b===null ? this.rgb[2] : b
491
+ );
492
+ if(hsv[0] !== null) {
493
+ this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0]));
494
+ }
495
+ if(hsv[2] !== 0) {
496
+ this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
497
+ }
498
+ this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
499
+
500
+ // update RGB according to final HSV, as some values might be trimmed
501
+ var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
502
+ this.rgb[0] = rgb[0];
503
+ this.rgb[1] = rgb[1];
504
+ this.rgb[2] = rgb[2];
505
+
506
+ this.exportColor(flags);
507
+ };
508
+
509
+
510
+ this.fromString = function(hex, flags) {
511
+ var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
512
+ if(!m) {
513
+ return false;
514
+ } else {
515
+ if(m[1].length === 6) { // 6-char notation
516
+ this.fromRGB(
517
+ parseInt(m[1].substr(0,2),16) / 255,
518
+ parseInt(m[1].substr(2,2),16) / 255,
519
+ parseInt(m[1].substr(4,2),16) / 255,
520
+ flags
521
+ );
522
+ } else { // 3-char notation
523
+ this.fromRGB(
524
+ parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
525
+ parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
526
+ parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
527
+ flags
528
+ );
529
+ }
530
+ return true;
531
+ }
532
+ };
533
+
534
+
535
+ this.toString = function() {
536
+ return (
537
+ (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
538
+ (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
539
+ (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
540
+ );
541
+ };
542
+
543
+
544
+ function RGB_HSV(r, g, b) {
545
+ var n = Math.min(Math.min(r,g),b);
546
+ var v = Math.max(Math.max(r,g),b);
547
+ var m = v - n;
548
+ if(m === 0) { return [ null, 0, v ]; }
549
+ var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
550
+ return [ h===6?0:h, m/v, v ];
551
+ }
552
+
553
+
554
+ function HSV_RGB(h, s, v) {
555
+ if(h === null) { return [ v, v, v ]; }
556
+ var i = Math.floor(h);
557
+ var f = i%2 ? h-i : 1-(h-i);
558
+ var m = v * (1 - s);
559
+ var n = v * (1 - s*f);
560
+ switch(i) {
561
+ case 6:
562
+ case 0: return [v,n,m];
563
+ case 1: return [n,v,m];
564
+ case 2: return [m,v,n];
565
+ case 3: return [m,n,v];
566
+ case 4: return [n,m,v];
567
+ case 5: return [v,m,n];
568
+ }
569
+ }
570
+
571
+
572
+ function removePicker() {
573
+ delete jscolor.picker.owner;
574
+ document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
575
+ }
576
+
577
+
578
+ function drawPicker(x, y) {
579
+ if(!jscolor.picker) {
580
+ jscolor.picker = {
581
+ box : document.createElement('div'),
582
+ boxB : document.createElement('div'),
583
+ pad : document.createElement('div'),
584
+ padB : document.createElement('div'),
585
+ padM : document.createElement('div'),
586
+ sld : document.createElement('div'),
587
+ sldB : document.createElement('div'),
588
+ sldM : document.createElement('div'),
589
+ btn : document.createElement('div'),
590
+ btnS : document.createElement('span'),
591
+ btnT : document.createTextNode(THIS.pickerCloseText)
592
+ };
593
+ for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
594
+ var seg = document.createElement('div');
595
+ seg.style.height = segSize+'px';
596
+ seg.style.fontSize = '1px';
597
+ seg.style.lineHeight = '0';
598
+ jscolor.picker.sld.appendChild(seg);
599
+ }
600
+ jscolor.picker.sldB.appendChild(jscolor.picker.sld);
601
+ jscolor.picker.box.appendChild(jscolor.picker.sldB);
602
+ jscolor.picker.box.appendChild(jscolor.picker.sldM);
603
+ jscolor.picker.padB.appendChild(jscolor.picker.pad);
604
+ jscolor.picker.box.appendChild(jscolor.picker.padB);
605
+ jscolor.picker.box.appendChild(jscolor.picker.padM);
606
+ jscolor.picker.btnS.appendChild(jscolor.picker.btnT);
607
+ jscolor.picker.btn.appendChild(jscolor.picker.btnS);
608
+ jscolor.picker.box.appendChild(jscolor.picker.btn);
609
+ jscolor.picker.boxB.appendChild(jscolor.picker.box);
610
+ }
611
+
612
+ var p = jscolor.picker;
613
+
614
+ // controls interaction
615
+ p.box.onmouseup =
616
+ p.box.onmouseout = function() { target.focus(); };
617
+ p.box.onmousedown = function() { abortBlur=true; };
618
+ p.box.onmousemove = function(e) {
619
+ if (holdPad || holdSld) {
620
+ holdPad && setPad(e);
621
+ holdSld && setSld(e);
622
+ if (document.selection) {
623
+ document.selection.empty();
624
+ } else if (window.getSelection) {
625
+ window.getSelection().removeAllRanges();
626
+ }
627
+ dispatchImmediateChange();
628
+ }
629
+ };
630
+ if('ontouchstart' in window) { // if touch device
631
+ var handle_touchmove = function(e) {
632
+ var event={
633
+ 'offsetX': e.touches[0].pageX-touchOffset.X,
634
+ 'offsetY': e.touches[0].pageY-touchOffset.Y
635
+ };
636
+ if (holdPad || holdSld) {
637
+ holdPad && setPad(event);
638
+ holdSld && setSld(event);
639
+ dispatchImmediateChange();
640
+ }
641
+ e.stopPropagation(); // prevent move "view" on broswer
642
+ e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
643
+ };
644
+ p.box.removeEventListener('touchmove', handle_touchmove, false)
645
+ p.box.addEventListener('touchmove', handle_touchmove, false)
646
+ }
647
+ p.padM.onmouseup =
648
+ p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
649
+ p.padM.onmousedown = function(e) {
650
+ // if the slider is at the bottom, move it up
651
+ switch(modeID) {
652
+ case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
653
+ case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
654
+ }
655
+ holdSld=false;
656
+ holdPad=true;
657
+ setPad(e);
658
+ dispatchImmediateChange();
659
+ };
660
+ if('ontouchstart' in window) {
661
+ p.padM.addEventListener('touchstart', function(e) {
662
+ touchOffset={
663
+ 'X': e.target.offsetParent.offsetLeft,
664
+ 'Y': e.target.offsetParent.offsetTop
665
+ };
666
+ this.onmousedown({
667
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
668
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
669
+ });
670
+ });
671
+ }
672
+ p.sldM.onmouseup =
673
+ p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
674
+ p.sldM.onmousedown = function(e) {
675
+ holdPad=false;
676
+ holdSld=true;
677
+ setSld(e);
678
+ dispatchImmediateChange();
679
+ };
680
+ if('ontouchstart' in window) {
681
+ p.sldM.addEventListener('touchstart', function(e) {
682
+ touchOffset={
683
+ 'X': e.target.offsetParent.offsetLeft,
684
+ 'Y': e.target.offsetParent.offsetTop
685
+ };
686
+ this.onmousedown({
687
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
688
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
689
+ });
690
+ });
691
+ }
692
+
693
+ // picker
694
+ var dims = getPickerDims(THIS);
695
+ p.box.style.width = dims[0] + 'px';
696
+ p.box.style.height = dims[1] + 'px';
697
+
698
+ // picker border
699
+ p.boxB.style.position = 'absolute';
700
+ p.boxB.style.clear = 'both';
701
+ p.boxB.style.left = x+'px';
702
+ p.boxB.style.top = y+'px';
703
+ p.boxB.style.zIndex = THIS.pickerZIndex;
704
+ p.boxB.style.border = THIS.pickerBorder+'px solid';
705
+ p.boxB.style.borderColor = THIS.pickerBorderColor;
706
+ p.boxB.style.background = THIS.pickerFaceColor;
707
+
708
+ // pad image
709
+ p.pad.style.width = jscolor.images.pad[0]+'px';
710
+ p.pad.style.height = jscolor.images.pad[1]+'px';
711
+
712
+ // pad border
713
+ p.padB.style.position = 'absolute';
714
+ p.padB.style.left = THIS.pickerFace+'px';
715
+ p.padB.style.top = THIS.pickerFace+'px';
716
+ p.padB.style.border = THIS.pickerInset+'px solid';
717
+ p.padB.style.borderColor = THIS.pickerInsetColor;
718
+
719
+ // pad mouse area
720
+ p.padM.style.position = 'absolute';
721
+ p.padM.style.left = '0';
722
+ p.padM.style.top = '0';
723
+ p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
724
+ p.padM.style.height = p.box.style.height;
725
+ p.padM.style.cursor = 'crosshair';
726
+
727
+ // slider image
728
+ p.sld.style.overflow = 'hidden';
729
+ p.sld.style.width = jscolor.images.sld[0]+'px';
730
+ p.sld.style.height = jscolor.images.sld[1]+'px';
731
+
732
+ // slider border
733
+ p.sldB.style.display = THIS.slider ? 'block' : 'none';
734
+ p.sldB.style.position = 'absolute';
735
+ p.sldB.style.right = THIS.pickerFace+'px';
736
+ p.sldB.style.top = THIS.pickerFace+'px';
737
+ p.sldB.style.border = THIS.pickerInset+'px solid';
738
+ p.sldB.style.borderColor = THIS.pickerInsetColor;
739
+
740
+ // slider mouse area
741
+ p.sldM.style.display = THIS.slider ? 'block' : 'none';
742
+ p.sldM.style.position = 'absolute';
743
+ p.sldM.style.right = '0';
744
+ p.sldM.style.top = '0';
745
+ p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
746
+ p.sldM.style.height = p.box.style.height;
747
+ try {
748
+ p.sldM.style.cursor = 'pointer';
749
+ } catch(eOldIE) {
750
+ p.sldM.style.cursor = 'hand';
751
+ }
752
+
753
+ // "close" button
754
+ function setBtnBorder() {
755
+ var insetColors = THIS.pickerInsetColor.split(/\s+/);
756
+ var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
757
+ p.btn.style.borderColor = pickerOutsetColor;
758
+ }
759
+ p.btn.style.display = THIS.pickerClosable ? 'block' : 'none';
760
+ p.btn.style.position = 'absolute';
761
+ p.btn.style.left = THIS.pickerFace + 'px';
762
+ p.btn.style.bottom = THIS.pickerFace + 'px';
763
+ p.btn.style.padding = '0 15px';
764
+ p.btn.style.height = '18px';
765
+ p.btn.style.border = THIS.pickerInset + 'px solid';
766
+ setBtnBorder();
767
+ p.btn.style.color = THIS.pickerButtonColor;
768
+ p.btn.style.font = '12px sans-serif';
769
+ p.btn.style.textAlign = 'center';
770
+ try {
771
+ p.btn.style.cursor = 'pointer';
772
+ } catch(eOldIE) {
773
+ p.btn.style.cursor = 'hand';
774
+ }
775
+ p.btn.onmousedown = function () {
776
+ THIS.hidePicker();
777
+ };
778
+ p.btnS.style.lineHeight = p.btn.style.height;
779
+
780
+ // load images in optimal order
781
+ switch(modeID) {
782
+ case 0: var padImg = 'hs.png'; break;
783
+ case 1: var padImg = 'hv.png'; break;
784
+ }
785
+ p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
786
+ p.padM.style.backgroundRepeat = "no-repeat";
787
+ p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
788
+ p.sldM.style.backgroundRepeat = "no-repeat";
789
+ p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
790
+ p.pad.style.backgroundRepeat = "no-repeat";
791
+ p.pad.style.backgroundPosition = "0 0";
792
+
793
+ // place pointers
794
+ redrawPad();
795
+ redrawSld();
796
+
797
+ jscolor.picker.owner = THIS;
798
+ document.getElementsByTagName('body')[0].appendChild(p.boxB);
799
+ }
800
+
801
+
802
+ function getPickerDims(o) {
803
+ var dims = [
804
+ 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] +
805
+ (o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0),
806
+ o.pickerClosable ?
807
+ 4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight :
808
+ 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1]
809
+ ];
810
+ return dims;
811
+ }
812
+
813
+
814
+ function redrawPad() {
815
+ // redraw the pad pointer
816
+ switch(modeID) {
817
+ case 0: var yComponent = 1; break;
818
+ case 1: var yComponent = 2; break;
819
+ }
820
+ var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
821
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
822
+ jscolor.picker.padM.style.backgroundPosition =
823
+ (THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
824
+ (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
825
+
826
+ // redraw the slider image
827
+ var seg = jscolor.picker.sld.childNodes;
828
+
829
+ switch(modeID) {
830
+ case 0:
831
+ var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
832
+ for(var i=0; i<seg.length; i+=1) {
833
+ seg[i].style.backgroundColor = 'rgb('+
834
+ (rgb[0]*(1-i/seg.length)*100)+'%,'+
835
+ (rgb[1]*(1-i/seg.length)*100)+'%,'+
836
+ (rgb[2]*(1-i/seg.length)*100)+'%)';
837
+ }
838
+ break;
839
+ case 1:
840
+ var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
841
+ var i = Math.floor(THIS.hsv[0]);
842
+ var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
843
+ switch(i) {
844
+ case 6:
845
+ case 0: rgb=[0,1,2]; break;
846
+ case 1: rgb=[1,0,2]; break;
847
+ case 2: rgb=[2,0,1]; break;
848
+ case 3: rgb=[2,1,0]; break;
849
+ case 4: rgb=[1,2,0]; break;
850
+ case 5: rgb=[0,2,1]; break;
851
+ }
852
+ for(var i=0; i<seg.length; i+=1) {
853
+ s = 1 - 1/(seg.length-1)*i;
854
+ c[1] = c[0] * (1 - s*f);
855
+ c[2] = c[0] * (1 - s);
856
+ seg[i].style.backgroundColor = 'rgb('+
857
+ (c[rgb[0]]*100)+'%,'+
858
+ (c[rgb[1]]*100)+'%,'+
859
+ (c[rgb[2]]*100)+'%)';
860
+ }
861
+ break;
862
+ }
863
+ }
864
+
865
+
866
+ function redrawSld() {
867
+ // redraw the slider pointer
868
+ switch(modeID) {
869
+ case 0: var yComponent = 2; break;
870
+ case 1: var yComponent = 1; break;
871
+ }
872
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
873
+ jscolor.picker.sldM.style.backgroundPosition =
874
+ '0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
875
+ }
876
+
877
+
878
+ function isPickerOwner() {
879
+ return jscolor.picker && jscolor.picker.owner === THIS;
880
+ }
881
+
882
+
883
+ function blurTarget() {
884
+ if(valueElement === target) {
885
+ THIS.importColor();
886
+ }
887
+ if(THIS.pickerOnfocus) {
888
+ THIS.hidePicker();
889
+ }
890
+ }
891
+
892
+
893
+ function blurValue() {
894
+ if(valueElement !== target) {
895
+ THIS.importColor();
896
+ }
897
+ }
898
+
899
+
900
+ function setPad(e) {
901
+ var mpos = jscolor.getRelMousePos(e);
902
+ var x = mpos.x - THIS.pickerFace - THIS.pickerInset;
903
+ var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
904
+ switch(modeID) {
905
+ case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
906
+ case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
907
+ }
908
+ }
909
+
910
+
911
+ function setSld(e) {
912
+ var mpos = jscolor.getRelMousePos(e);
913
+ var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
914
+ switch(modeID) {
915
+ case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
916
+ case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
917
+ }
918
+ }
919
+
920
+
921
+ function dispatchImmediateChange() {
922
+ if (THIS.onImmediateChange) {
923
+ var callback;
924
+ if (typeof THIS.onImmediateChange === 'string') {
925
+ callback = new Function (THIS.onImmediateChange);
926
+ } else {
927
+ callback = THIS.onImmediateChange;
928
+ }
929
+ callback.call(THIS);
930
+ }
931
+ }
932
+
933
+
934
+ var THIS = this;
935
+ var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
936
+ var abortBlur = false;
937
+ var
938
+ valueElement = jscolor.fetchElement(this.valueElement),
939
+ styleElement = jscolor.fetchElement(this.styleElement);
940
+ var
941
+ holdPad = false,
942
+ holdSld = false,
943
+ touchOffset = {};
944
+ var
945
+ leaveValue = 1<<0,
946
+ leaveStyle = 1<<1,
947
+ leavePad = 1<<2,
948
+ leaveSld = 1<<3;
949
+
950
+ // target
951
+ jscolor.addEvent(target, 'focus', function() {
952
+ if(THIS.pickerOnfocus) { THIS.showPicker(); }
953
+ });
954
+ jscolor.addEvent(target, 'blur', function() {
955
+ if(!abortBlur) {
956
+ window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
957
+ } else {
958
+ abortBlur = false;
959
+ }
960
+ });
961
+
962
+ // valueElement
963
+ if(valueElement) {
964
+ var updateField = function() {
965
+ THIS.fromString(valueElement.value, leaveValue);
966
+ dispatchImmediateChange();
967
+ };
968
+ jscolor.addEvent(valueElement, 'keyup', updateField);
969
+ jscolor.addEvent(valueElement, 'input', updateField);
970
+ jscolor.addEvent(valueElement, 'blur', blurValue);
971
+ valueElement.setAttribute('autocomplete', 'off');
972
+ }
973
+
974
+ // styleElement
975
+ if(styleElement) {
976
+ styleElement.jscStyle = {
977
+ backgroundImage : styleElement.style.backgroundImage,
978
+ backgroundColor : styleElement.style.backgroundColor,
979
+ color : styleElement.style.color
980
+ };
981
+ }
982
+
983
+ // require images
984
+ switch(modeID) {
985
+ case 0: jscolor.requireImage('hs.png'); break;
986
+ case 1: jscolor.requireImage('hv.png'); break;
987
+ }
988
+ jscolor.requireImage('cross.gif');
989
+ jscolor.requireImage('arrow.gif');
990
+
991
+ this.importColor();
992
+ }
993
+
994
+ };
995
+
996
+
997
+ jscolor.install();
{js → admin/js}/scripts.js RENAMED
@@ -1,41 +1,16 @@
1
-
2
  jQuery(document).ready(function($)
3
  {
4
-
5
-
6
-
7
- $(document).on('click', '.load-more .load', function()
8
- {
9
- $(this).html('loading...');
10
- var postid = parseInt($(this).attr('postid'));
11
- var per_page = parseInt($(this).attr('per_page'));
12
- var offset = parseInt($(this).attr('offset'));
13
-
14
- $.ajax(
15
- {
16
- type: 'POST',
17
- url:timeline_um_ajax.timeline_um_ajaxurl,
18
- data: {"action": "timeline_um_comments_by_postid", "postid":postid,"per_page":per_page,"offset":offset},
19
- success: function(data)
20
- {
21
-
22
- $('.post-grid-container-'+postid).append(data);
23
- $('.comment-load-more-'+postid).attr('offset',(offset+per_page));
24
 
25
 
26
-
27
- }
28
- });
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
  })
 
39
 
40
 
41
 
@@ -82,6 +57,35 @@ jQuery(document).ready(function($)
82
 
83
 
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
  });
87
 
 
1
  jQuery(document).ready(function($)
2
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
 
5
+
6
+ $(document).on('click', '.post-grid-reset-taxonomy', function()
7
+ {
8
+ $('.post_grid_taxonomy_category').prop('checked', false);
9
+ $('.post_grid_taxonomy').prop('checked', false);
10
+
11
+
 
 
 
 
 
12
  })
13
+
14
 
15
 
16
 
57
 
58
 
59
 
60
+
61
+
62
+ $(document).on('click', '.post-grid-builder .canvas .remove', function()
63
+ {
64
+ $(this).parent().parent().remove();
65
+
66
+ })
67
+
68
+
69
+
70
+
71
+
72
+
73
+ $(document).on('click', '.post-grid-builder .canvas .header', function()
74
+ {
75
+
76
+ if($(this).parent().hasClass('active'))
77
+ {
78
+ $(this).parent().removeClass('active');
79
+ }
80
+ else
81
+ {
82
+ $(this).parent().addClass('active');
83
+ }
84
+
85
+ })
86
+
87
+
88
+
89
 
90
  });
91
 
css/icons/facebook.png CHANGED
Binary file
css/icons/gplus.png CHANGED
Binary file
css/icons/link.png ADDED
Binary file
css/icons/twitter.png CHANGED
Binary file
css/icons/zoom.png ADDED
Binary file
css/style.css CHANGED
@@ -3,29 +3,6 @@
3
 
4
 
5
 
6
- ul.post_grid_bg_img_list{}
7
-
8
- ul.post_grid_bg_img_list li {
9
- display: inline-block;
10
- margin: 5px;
11
- }
12
- ul.post_grid_bg_img_list li.bg-selected {}
13
-
14
- ul.post_grid_bg_img_list li img{border: 2px solid #ffffff;}
15
-
16
- ul.post_grid_bg_img_list li.bg-selected img{
17
- border: 2px solid #ff5a11;
18
- }
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
 
30
  .post-grid-container-main {
31
  padding: 50px 20px;
@@ -35,73 +12,18 @@ ul.post_grid_bg_img_list li.bg-selected img{
35
  /**************/
36
  .post-grid-container .social-icon {
37
  color: rgb(255, 0, 0);
38
- position: absolute;
 
39
  transition: all 0.3s ease 0s;
40
  }
41
 
42
 
43
- .post-grid-container .social-icon.LeftTop {
44
- top: 10px;
45
- left: -100px;
46
- }
47
- .post-grid-container .thumb:hover .social-icon.LeftTop {
48
- left: 10px;
49
- }
50
-
51
-
52
-
53
- .post-grid-container .social-icon.LeftBottom {
54
- bottom: 10px;
55
- left: -100px;
56
- }
57
- .post-grid-container .thumb:hover .social-icon.LeftBottom {
58
- left: 10px;
59
- }
60
- .post-grid-container .social-icon.RightTop {
61
- top: 10px;
62
- right: -100px;
63
- }
64
- .post-grid-container .thumb:hover .social-icon.RightTop {
65
- right: 10px;
66
- }
67
- .post-grid-container .social-icon.RightBottom {
68
- bottom: 10px;
69
- right: -100px;
70
- }
71
-
72
- .post-grid-container .thumb:hover .social-icon.RightBottom {
73
- right: 10px;
74
- }
75
-
76
-
77
- .post-grid-container .social-icon.TopMiddle {
78
- text-align: center;
79
- top: -100px;
80
- width: 100%;
81
- }
82
-
83
- .post-grid-container .thumb:hover .social-icon.TopMiddle {
84
- top: 15%;
85
- }
86
-
87
-
88
- .post-grid-container .social-icon.BottomMiddle {
89
- text-align: center;
90
- bottom: -100px;
91
- width: 100%;
92
- }
93
-
94
- .post-grid-container .thumb:hover .social-icon.BottomMiddle {
95
- bottom: 15%;
96
- }
97
-
98
-
99
-
100
 
101
 
102
 
103
 
104
  .post-grid-container .social-icon span {
 
105
  display: inline-block;
106
  height: 24px;
107
  width: 24px;
@@ -171,97 +93,6 @@ ul.post_grid_bg_img_list li.bg-selected img{
171
 
172
 
173
 
174
- /* ############################################## */
175
-
176
-
177
-
178
-
179
- .post-grid-container .link {
180
- position: absolute;
181
- text-align: center;
182
- width: 100%;
183
- transition: all 0.5s ease 0s;
184
- }
185
-
186
-
187
- .post-grid-container .link.TopMiddle {
188
- top: -100%;
189
-
190
- }
191
-
192
- .post-grid-container .thumb:hover .link.TopMiddle {
193
- top: 30%;
194
-
195
- }
196
- .post-grid-container .link.BottomMiddle {
197
- bottom: -100%;
198
- }
199
-
200
- .post-grid-container .thumb:hover .link.BottomMiddle {
201
- bottom: 50%;
202
-
203
- }
204
- .post-grid-container .link.LeftMiddle {
205
- left: -100%;
206
- top: 30%;
207
-
208
- }
209
-
210
- .post-grid-container .thumb:hover .link.LeftMiddle {
211
- left: 0;
212
-
213
- }
214
-
215
-
216
- .post-grid-container .link.RightMiddle {
217
- right: -100%;
218
- top: 30%;
219
- }
220
-
221
- .post-grid-container .thumb:hover .link.RightMiddle {
222
- right: 0;
223
-
224
- }
225
-
226
-
227
-
228
- .post-grid-container .link a {
229
- background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
230
- border: 1px solid rgb(226, 226, 226);
231
- border-radius: 3px;
232
- color: rgb(255, 255, 255) !important;
233
- font-size: 12px;
234
- padding: 5px 15px;
235
- text-decoration: none;
236
- }
237
-
238
- /* ############################################## */
239
-
240
- .post-grid-container .link.zoomIn {
241
- transform: scale(0);
242
- }
243
-
244
- .post-grid-container .thumb:hover .link.zoomIn {
245
- transform: scale(1.2);
246
-
247
- }
248
-
249
- .post-grid-container .link.fadeIn {
250
- opacity: 0;
251
- }
252
-
253
- .post-grid-container .thumb:hover .link.fadeIn {
254
- opacity: 1;
255
- }
256
-
257
- .post-grid-container .link.rotate {
258
- transform: rotate(0deg);
259
- }
260
-
261
- .post-grid-container .thumb:hover .link.rotate {
262
- transform: rotate(360deg);
263
- }
264
-
265
 
266
 
267
 
@@ -311,6 +142,69 @@ ul.post_grid_bg_img_list li.bg-selected img{
311
 
312
 
313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
 
315
 
316
 
3
 
4
 
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  .post-grid-container-main {
8
  padding: 50px 20px;
12
  /**************/
13
  .post-grid-container .social-icon {
14
  color: rgb(255, 0, 0);
15
+ padding: 10px;
16
+ text-align: left;
17
  transition: all 0.3s ease 0s;
18
  }
19
 
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
 
23
 
24
 
25
  .post-grid-container .social-icon span {
26
+ background-size: 100% auto !important;
27
  display: inline-block;
28
  height: 24px;
29
  width: 24px;
93
 
94
 
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
 
98
 
142
 
143
 
144
 
145
+ /*hover-items*/
146
+
147
+
148
+ .post-grid-container .hover-items {
149
+ display: none;
150
+ transition: all 0.7s ease 0s;
151
+ width: 100%;
152
+ }
153
+
154
+ .post-grid-container .grid-single:hover .hover-items {
155
+ margin: 0 auto;
156
+ padding: 0;
157
+ position: absolute;
158
+ text-align: center;
159
+ top: 0;
160
+ width: 100%;
161
+ z-index: 2147483647;
162
+ display:block;
163
+ }
164
+
165
+
166
+
167
+ .post-grid-container .hover-items a {
168
+ background-attachment: scroll;
169
+ background-clip: border-box;
170
+ background-color: rgb(255, 255, 255);
171
+ background-image: none;
172
+ background-origin: padding-box;
173
+ background-position: 0 0;
174
+ background-repeat: repeat;
175
+ background-size: 100% auto !important;
176
+ border-radius: 50%;
177
+ box-shadow: 0 0 7px -2px rgb(102, 102, 102);
178
+ cursor: pointer;
179
+ display: inline-block;
180
+ height: 50px;
181
+ margin-top: 30px;
182
+ vertical-align: top;
183
+ width: 50px;
184
+ }
185
+
186
+
187
+ .post-grid-container .hover-items .zoom {
188
+ background: url("icons/zoom.png") repeat scroll 0 0 rgba(255, 255, 255, 0.7);
189
+ }
190
+ .post-grid-container .hover-items .post-link {
191
+ background: url("icons/link.png") repeat scroll 0 0 rgba(255, 255, 255, 0.7);
192
+ }
193
+
194
+
195
+
196
+ .post-grid-container .grid-single:hover .social-icon {
197
+ margin: 0 auto;
198
+ padding: 0;
199
+ position: absolute;
200
+ text-align: center;
201
+ top: 100px;
202
+ width: 100%;
203
+ z-index: 2147483647;
204
+ }
205
+
206
+
207
+
208
 
209
 
210
 
includes/PostGridClass.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class PostgridClass
5
+ {
6
+
7
+ public $grid_items = array('post_title'=>'Title',
8
+ 'content'=>'Content',
9
+ 'thumbnail'=>'Thumbnail',
10
+ 'meta'=>'Meta',
11
+ 'social'=>'Social',
12
+ 'hover_items'=>'Hover Items',
13
+ );
14
+
15
+ public $grid_items_properties = array('content'=> array('body','read_more'),
16
+ 'thumbnail'=> array('video','img'),
17
+ 'meta'=> array( 'post_date','post_author','terms','comments_count',),
18
+ 'social'=> array('facebook','twitter','googleplus'),
19
+ 'hover_items'=> array('zoom','link'),
20
+ );
21
+
22
+
23
+
24
+ public $post_grid_items_display = array('post_title'=>'on',
25
+ 'content'=>'on',
26
+ 'thumbnail'=>'on',
27
+ 'meta'=>'on',
28
+ 'social'=>'on',
29
+ 'hover_items'=>'on',
30
+ );
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+ public function settings_grid_get_post_meta($post_id,$meta_key)
41
+ {
42
+ return get_post_meta( $post_id, $meta_key, true );
43
+
44
+ }
45
+
46
+
47
+
48
+
49
+
50
+ public function post_grid_settings_builder_saved_items()
51
+ {
52
+
53
+ global $post;
54
+ $post_grid_items = $this->settings_grid_get_post_meta($post->ID, 'post_grid_items');
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
+
61
+ if(empty($post_grid_items))
62
+ {
63
+ $post_grid_items = $this->grid_items;
64
+ }
65
+
66
+
67
+ foreach($post_grid_items as $key=>$name)
68
+ {
69
+
70
+ if(empty($post_grid_wrapper[$key]['start']))
71
+ {
72
+ $post_grid_wrapper[$key]['start'] = '';
73
+ }
74
+
75
+ if(empty($post_grid_wrapper[$key]['end']))
76
+ {
77
+ $post_grid_wrapper[$key]['end'] = '';
78
+ }
79
+
80
+
81
+
82
+
83
+ $html .= '<div class="saved-item" data-class="saved-item" id="'.$key.'"><div class="header">'.$name;
84
+ if(!empty($post_grid_items_display[$key]))
85
+ {
86
+ $html .= '<span class="input-switch"><input checked type="checkbox" id="switch-'.$key.'" name="post_grid_items_display['.$key.']" class="switch" />
87
+ <label title="Display on grid ?" for="switch-'.$key.'">&nbsp;</label>
88
+ </span>';
89
+
90
+ }
91
+ else
92
+ {
93
+ $html .= '<span class="input-switch"><input type="checkbox" id="switch-'.$key.'" name="post_grid_items_display['.$key.']" class="switch" />
94
+ <label title="Display on grid ?" for="switch-'.$key.'">&nbsp;</label>
95
+ </span>';
96
+ }
97
+
98
+ $html .= '<span class="remove">X</span>';
99
+
100
+ $html .= '</div>';
101
+
102
+ $html .= '<input type="hidden" name="post_grid_items['.$key.']" value="'.$name.'" />';
103
+ $html .= '<div class="options">';
104
+ $html .= '<b>'.$name.'</b> wrapper <input placeholder="<div>" type="text" name="post_grid_wrapper['.$key.'][start]" value="'.htmlentities($post_grid_wrapper[$key]['start'],ENT_QUOTES).'" /> <b>'.$name.'</b> goes here <input placeholder="</div>" type="text" name="post_grid_wrapper['.$key.'][end]" value="'.htmlentities($post_grid_wrapper[$key]['end'],ENT_QUOTES).'" />';
105
+
106
+ if($key =='meta_fields')
107
+ {
108
+ $html .= '<div class="options-meta_fields"><br /> <br />';
109
+ $html .= 'Custom Meta Fields. comma separated';
110
+
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>';
118
+ $html .= '</div>';
119
+
120
+
121
+
122
+ }
123
+ return $html;
124
+ }
125
+
126
+
127
+ public function post_grid_settings_builder_items()
128
+ {
129
+ global $post;
130
+ $grid_items = $this->grid_items;
131
+ $post_grid_wrapper = $this->settings_grid_get_post_meta($post->ID, 'post_grid_wrapper');
132
+ $post_grid_items_display = $this->settings_grid_get_post_meta($post->ID, 'post_grid_items_display');
133
+ $html = '';
134
+
135
+
136
+ foreach($grid_items as $key=>$name)
137
+ {
138
+
139
+ if(empty($post_grid_wrapper[$key]['start']))
140
+ {
141
+ $post_grid_wrapper[$key]['start'] = '';
142
+ }
143
+
144
+ if(empty($post_grid_wrapper[$key]['end']))
145
+ {
146
+ $post_grid_wrapper[$key]['end'] = '';
147
+ }
148
+
149
+ $html .= '<div title="'.$name.'" class="item draggable" id="'.$key.'">'.$name;
150
+
151
+
152
+
153
+ $html .= '</div>';
154
+
155
+
156
+
157
+ }
158
+ return $html;
159
+ }
160
+
161
+
162
+
163
+ public function settings_grid_items()
164
+ {
165
+ global $post;
166
+
167
+ $html = '';
168
+ $html .= '<div class="post-grid-builder">';
169
+ $html .= '<div class="items" id="items">';
170
+ $html .= '<p><b>Grid Items</b></p>';
171
+ $html .= '<p>Post Grid items drag on <b>Grid Layout</b> to build your own layout.</p>';
172
+
173
+ $html .= $this->post_grid_settings_builder_items();
174
+ $html .= '</div>';
175
+ $html .= '<div id="canvas" class="canvas droppable" >';
176
+ $html .= '<p><b>Grid Layout</b></p>';
177
+ $html .= '<p>Drag-drop items to re-order. multiple items not supported for each. for example you can\'t add two "Title" on layout.</p>';
178
+ $html .= '<div class="items-container sortable" >';
179
+ $html .= $this->post_grid_settings_builder_saved_items();
180
+ $html .= '</div></div>';
181
+
182
+ $html .= '</div>';
183
+
184
+
185
+ return $html;
186
+ }
187
+
188
+
189
+ public function post_grid_content()
190
+ {
191
+
192
+ }
193
+
194
+
195
+ }
includes/post-grid-functions.php CHANGED
@@ -48,108 +48,6 @@ function post_grid_get_all_product_ids($postid)
48
 
49
 
50
 
51
-
52
-
53
-
54
- function post_grid_get_taxonomy_category($postid)
55
- {
56
-
57
-
58
-
59
- $post_grid_taxonomy = get_post_meta( $postid, 'post_grid_taxonomy', true );
60
- if(empty($post_grid_taxonomy))
61
- {
62
- $post_grid_taxonomy= "";
63
- }
64
- $post_grid_taxonomy_category = get_post_meta( $postid, 'post_grid_taxonomy_category', true );
65
-
66
-
67
- if(empty($post_grid_taxonomy_category))
68
- {
69
- $post_grid_taxonomy_category =array('none'); // an empty array when no category element selected
70
-
71
-
72
- }
73
-
74
-
75
-
76
- if(!isset($_POST['taxonomy']))
77
- {
78
- $taxonomy =$post_grid_taxonomy;
79
- }
80
- else
81
- {
82
- $taxonomy = $_POST['taxonomy'];
83
- }
84
-
85
-
86
- $args=array(
87
- 'orderby' => 'name',
88
- 'order' => 'ASC',
89
- 'taxonomy' => $taxonomy,
90
- );
91
-
92
- $categories = get_categories($args);
93
-
94
-
95
- if(empty($categories))
96
- {
97
- echo "No Items Found!";
98
- }
99
-
100
-
101
- $return_string = '';
102
- $return_string .= '<ul style="margin: 0;">';
103
-
104
- foreach($categories as $category){
105
-
106
- if(array_search($category->cat_ID, $post_grid_taxonomy_category))
107
- {
108
- $return_string .= '<li class='.$category->cat_ID.'><label ><input class="post_grid_taxonomy_category" checked type="checkbox" name="post_grid_taxonomy_category['.$category->cat_ID.']" value ="'.$category->cat_ID.'" />'.$category->cat_name.'</label ></li>';
109
- }
110
-
111
- else
112
- {
113
- $return_string .= '<li class='.$category->cat_ID.'><label ><input class="post_grid_taxonomy_category" type="checkbox" name="post_grid_taxonomy_category['.$category->cat_ID.']" value ="'.$category->cat_ID.'" />'.$category->cat_name.'</label ></li>';
114
- }
115
-
116
-
117
-
118
-
119
- }
120
-
121
- $return_string .= '</ul>';
122
-
123
- echo $return_string;
124
-
125
- if(isset($_POST['taxonomy']))
126
- {
127
- die();
128
- }
129
-
130
-
131
- }
132
-
133
- add_action('wp_ajax_post_grid_get_taxonomy_category', 'post_grid_get_taxonomy_category');
134
- add_action('wp_ajax_nopriv_post_grid_get_taxonomy_category', 'post_grid_get_taxonomy_category');
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
  // solve error replace #038; by &
154
 
155
  function post_grid_fix_pagination($link) {
@@ -254,4 +152,5 @@ function post_grid_dark_color($input_color)
254
  }
255
 
256
 
257
-
 
48
 
49
 
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  // solve error replace #038; by &
52
 
53
  function post_grid_fix_pagination($link) {
152
  }
153
 
154
 
155
+
156
+
includes/post-grid-meta.php CHANGED
@@ -70,14 +70,10 @@ function meta_boxes_post_grid_input( $post ) {
70
  $post_grid_bg_img = get_post_meta( $post->ID, 'post_grid_bg_img', true );
71
  $post_grid_thumb_size = get_post_meta( $post->ID, 'post_grid_thumb_size', true );
72
  $post_grid_empty_thumb = get_post_meta( $post->ID, 'post_grid_empty_thumb', true );
73
-
74
- $post_grid_social_share_position = get_post_meta( $post->ID, 'post_grid_social_share_position', true );
75
  $post_grid_social_share_display = get_post_meta( $post->ID, 'post_grid_social_share_display', true );
76
  $post_grid_pagination_display = get_post_meta( $post->ID, 'post_grid_pagination_display', true );
77
-
78
-
79
- $post_grid_read_more_position = get_post_meta( $post->ID, 'post_grid_read_more_position', true );
80
- $post_grid_read_more_hov_in_style = get_post_meta( $post->ID, 'post_grid_read_more_hov_in_style', true );
81
  $post_grid_excerpt_count = get_post_meta( $post->ID, 'post_grid_excerpt_count', true );
82
  $post_grid_read_more_text = get_post_meta( $post->ID, 'post_grid_read_more_text', true );
83
 
@@ -86,23 +82,26 @@ function meta_boxes_post_grid_input( $post ) {
86
  $post_grid_posttype = get_post_meta( $post->ID, 'post_grid_posttype', true );
87
 
88
  $post_grid_items_width = get_post_meta( $post->ID, 'post_grid_items_width', true );
89
- //$post_grid_thumb_width = get_post_meta( $post->ID, 'post_grid_thumb_width', true );
90
  $post_grid_thumb_height = get_post_meta( $post->ID, 'post_grid_thumb_height', true );
91
 
92
  $post_grid_meta_author_display = get_post_meta( $post->ID, 'post_grid_meta_author_display', true );
93
  $post_grid_meta_date_display = get_post_meta( $post->ID, 'post_grid_meta_date_display', true );
94
  $post_grid_meta_categories_display = get_post_meta( $post->ID, 'post_grid_meta_categories_display', true );
95
  $post_grid_meta_tags_display = get_post_meta( $post->ID, 'post_grid_meta_tags_display', true );
96
- $post_grid_meta_comments_display = get_post_meta( $post->ID, 'post_grid_meta_comments_display', true );
97
-
98
-
 
 
 
 
99
 
100
  ?>
101
 
102
- <div class="para-settings">
103
  <div class="option-box">
104
  <p class="option-title">Shortcode</p>
105
- <p class="option-info">Copy this shortcode and paste on page or post where you want to display slider. <br />Use PHP code to your themes file to display slider.</p>
106
  <textarea cols="50" rows="1" style="background:#bfefff" onClick="this.select();" >[post_grid <?php echo ' id="'.$post->ID.'"';?> ]</textarea>
107
  <br /><br />
108
  PHP Code:<br />
@@ -114,6 +113,7 @@ function meta_boxes_post_grid_input( $post ) {
114
  <li nav="1" class="nav1 active">Options</li>
115
  <li nav="2" class="nav2">Style</li>
116
  <li nav="3" class="nav3">Content</li>
 
117
  </ul> <!-- tab-nav end -->
118
 
119
  <ul class="box">
@@ -163,7 +163,12 @@ function meta_boxes_post_grid_input( $post ) {
163
  <p class="option-info"></p>
164
  <select name="post_grid_themes" >
165
  <option value="flat" <?php if($post_grid_themes=="flat")echo "selected"; ?>>Flat</option>
166
- <option value="rounded" <?php if($post_grid_themes=="rounded")echo "selected"; ?>>Rounded</option>
 
 
 
 
 
167
  </select>
168
  </div>
169
 
@@ -346,7 +351,7 @@ function meta_boxes_post_grid_input( $post ) {
346
  </div>
347
 
348
  <div class="option-box">
349
- <p class="option-title">Display Social Share Buttons Display</p>
350
  <p class="option-info"></p>
351
  <select name="post_grid_social_share_display" >
352
  <option value="yes" <?php if($post_grid_social_share_display=="yes")echo "selected"; ?>>Yes</option>
@@ -359,62 +364,11 @@ function meta_boxes_post_grid_input( $post ) {
359
 
360
 
361
 
362
- <div class="option-box">
363
- <p class="option-title">Social Share buttons position</p>
364
- <p class="option-info"></p>
365
- <select name="post_grid_social_share_position" >
366
- <option value="LeftTop" <?php if($post_grid_social_share_position=="LeftTop")echo "selected"; ?>>Left Top</option>
367
- <option value="LeftBottom" <?php if($post_grid_social_share_position=="LeftBottom")echo "selected"; ?>>Left Bottom</option>
368
- <option value="RightTop" <?php if($post_grid_social_share_position=="RightTop")echo "selected"; ?>>Right Top</option>
369
- <option value="RightBottom" <?php if($post_grid_social_share_position=="RightBottom")echo "selected"; ?>>Right Bottom</option>
370
-
371
- <option value="TopMiddle" <?php if($post_grid_social_share_position=="TopMiddle")echo "selected"; ?>>Top Middle</option>
372
- <option value="BottomMiddle" <?php if($post_grid_social_share_position=="BottomMiddle")echo "selected"; ?>>Bottom Middle</option>
373
-
374
-
375
- </select>
376
- </div>
377
-
378
-
379
-
380
- <div class="option-box">
381
 
382
 
383
- <p class="option-title">Read more position</p>
384
- <p class="option-info"></p>
385
 
386
- <select name="post_grid_read_more_position" >
387
- <option value="TopMiddle" <?php if($post_grid_read_more_position=="TopMiddle")echo "selected"; ?>>Top Middle</option>
388
- <option value="LeftMiddle" <?php if($post_grid_read_more_position=="LeftMiddle")echo "selected"; ?>>Left Middle</option>
389
- <option value="RightMiddle" <?php if($post_grid_read_more_position=="RightMiddle")echo "selected"; ?>>Right Middle</option>
390
- <option value="BottomMiddle" <?php if($post_grid_read_more_position=="BottomMiddle")echo "selected"; ?>>Bottom Middle</option>
391
-
392
- </select>
393
-
394
-
395
- <p class="option-title">Read more hover style</p>
396
- <p class="option-info"></p>
397
- <select name="post_grid_read_more_hov_in_style" >
398
- <option value="zoomIn" <?php if($post_grid_read_more_hov_in_style=="zoomIn")echo "selected"; ?>>ZoomIn</option>
399
- <option value="fadeIn" <?php if($post_grid_read_more_hov_in_style=="fadeIn")echo "selected"; ?>>FadeIn</option>
400
- <option value="rotate" <?php if($post_grid_read_more_hov_in_style=="rotate")echo "selected"; ?>>Rotate</option>
401
-
402
- </select>
403
- <p class="option-title">Content excerpt count</p>
404
- <p class="option-info"></p>
405
- <input type="text" placeholder="30" name="post_grid_excerpt_count" value="<?php if(!empty($post_grid_excerpt_count)) echo $post_grid_excerpt_count; ?>" /><br />
406
-
407
- <p class="option-title">Read more Text</p>
408
- <p class="option-info"></p>
409
- <input type="text" placeholder="Read More" name="post_grid_read_more_text" value="<?php if(!empty($post_grid_read_more_text)) echo $post_grid_read_more_text; else echo 'Read More'; ?>" /><br />
410
-
411
-
412
-
413
-
414
-
415
-
416
-
417
- </div>
418
 
419
 
420
  <div class="option-box">
@@ -455,7 +409,7 @@ function meta_boxes_post_grid_input( $post ) {
455
 
456
 
457
  <div class="option-box">
458
- <p class="option-title">Display Comments</p>
459
  <p class="option-info"></p>
460
  <select name="post_grid_meta_comments_display" >
461
  <option value="yes" <?php if($post_grid_meta_comments_display=="yes")echo "selected"; ?>>Yes</option>
@@ -469,6 +423,19 @@ function meta_boxes_post_grid_input( $post ) {
469
  </li>
470
  <li style="display: none;" class="box3 tab-box ">
471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  <div class="option-box">
473
  <p class="option-title"><?php _e('Post query order','post_grid'); ?></p>
474
  <p class="option-info"></p>
@@ -490,11 +457,10 @@ function meta_boxes_post_grid_input( $post ) {
490
 
491
  <option value="author" <?php if($post_grid_query_orderby=="author") echo "selected"; ?>>Author</option>
492
  <option value="title" <?php if($post_grid_query_orderby=="title") echo "selected"; ?>>Title</option>
493
- <option value="name" <?php if($post_grid_query_orderby=="name") echo "selected"; ?>>Name</option> <option value="type" <?php if($post_grid_query_orderby=="type") echo "selected"; ?>>type</option> <option value="DESC" <?php if($post_grid_query_orderby=="DESC") echo "selected"; ?>>DESC</option>
494
 
495
 
496
-
497
- <option value="DESC" <?php if($post_grid_query_orderby=="DESC") echo "selected"; ?>>DESC</option>
498
 
499
  </select>
500
  </div>
@@ -533,27 +499,92 @@ function meta_boxes_post_grid_input( $post ) {
533
  }
534
  ?>
535
  </div>
536
-
537
-
538
-
539
-
540
- </li>
541
- </ul>
542
-
543
-
544
-
545
-
546
-
547
-
548
-
549
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550
 
 
 
 
 
 
 
 
551
 
 
552
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
 
555
 
556
  </div>
 
 
 
 
 
 
 
557
  <?php
558
 
559
 
@@ -600,21 +631,20 @@ function meta_boxes_post_grid_save( $post_id ) {
600
  $post_grid_thumb_size = sanitize_text_field( $_POST['post_grid_thumb_size'] );
601
  $post_grid_empty_thumb = sanitize_text_field( $_POST['post_grid_empty_thumb'] );
602
 
603
- $post_grid_social_share_position = sanitize_text_field( $_POST['post_grid_social_share_position'] );
604
  $post_grid_social_share_display = sanitize_text_field( $_POST['post_grid_social_share_display'] );
605
  $post_grid_pagination_display = sanitize_text_field( $_POST['post_grid_pagination_display'] );
606
 
607
- $post_grid_read_more_position = sanitize_text_field( $_POST['post_grid_read_more_position'] );
608
- $post_grid_read_more_hov_in_style = sanitize_text_field( $_POST['post_grid_read_more_hov_in_style'] );
609
  $post_grid_excerpt_count = sanitize_text_field( $_POST['post_grid_excerpt_count'] );
610
  $post_grid_read_more_text = sanitize_text_field( $_POST['post_grid_read_more_text'] );
611
 
612
  $post_grid_query_order = sanitize_text_field( $_POST['post_grid_query_order'] );
613
  $post_grid_query_orderby = sanitize_text_field( $_POST['post_grid_query_orderby'] );
614
- $post_grid_posttype = stripslashes_deep( $_POST['post_grid_posttype'] );
 
615
 
616
  $post_grid_items_width = sanitize_text_field( $_POST['post_grid_items_width'] );
617
- //$post_grid_thumb_width = sanitize_text_field( $_POST['post_grid_thumb_width'] );
618
  $post_grid_thumb_height = sanitize_text_field( $_POST['post_grid_thumb_height'] );
619
 
620
  $post_grid_meta_author_display = sanitize_text_field( $_POST['post_grid_meta_author_display'] );
@@ -623,8 +653,11 @@ function meta_boxes_post_grid_save( $post_id ) {
623
  $post_grid_meta_tags_display = sanitize_text_field( $_POST['post_grid_meta_tags_display'] );
624
  $post_grid_meta_comments_display = sanitize_text_field( $_POST['post_grid_meta_comments_display'] );
625
 
626
-
627
 
 
 
 
 
628
 
629
  // Update the meta field in the database.
630
  update_post_meta( $post_id, 'post_grid_post_per_page', $post_grid_post_per_page );
@@ -635,12 +668,9 @@ function meta_boxes_post_grid_save( $post_id ) {
635
 
636
  update_post_meta( $post_id, 'post_grid_thumb_size', $post_grid_thumb_size );
637
  update_post_meta( $post_id, 'post_grid_empty_thumb', $post_grid_empty_thumb );
638
- update_post_meta( $post_id, 'post_grid_social_share_position', $post_grid_social_share_position );
639
  update_post_meta( $post_id, 'post_grid_social_share_display', $post_grid_social_share_display );
640
  update_post_meta( $post_id, 'post_grid_pagination_display', $post_grid_pagination_display );
641
-
642
- update_post_meta( $post_id, 'post_grid_read_more_position', $post_grid_read_more_position );
643
- update_post_meta( $post_id, 'post_grid_read_more_hov_in_style', $post_grid_read_more_hov_in_style );
644
  update_post_meta( $post_id, 'post_grid_excerpt_count', $post_grid_excerpt_count );
645
  update_post_meta( $post_id, 'post_grid_read_more_text', $post_grid_read_more_text );
646
 
@@ -659,7 +689,10 @@ function meta_boxes_post_grid_save( $post_id ) {
659
  update_post_meta( $post_id, 'post_grid_meta_comments_display', $post_grid_meta_comments_display );
660
 
661
 
662
-
 
 
 
663
  }
664
  add_action( 'save_post', 'meta_boxes_post_grid_save' );
665
 
70
  $post_grid_bg_img = get_post_meta( $post->ID, 'post_grid_bg_img', true );
71
  $post_grid_thumb_size = get_post_meta( $post->ID, 'post_grid_thumb_size', true );
72
  $post_grid_empty_thumb = get_post_meta( $post->ID, 'post_grid_empty_thumb', true );
73
+
 
74
  $post_grid_social_share_display = get_post_meta( $post->ID, 'post_grid_social_share_display', true );
75
  $post_grid_pagination_display = get_post_meta( $post->ID, 'post_grid_pagination_display', true );
76
+
 
 
 
77
  $post_grid_excerpt_count = get_post_meta( $post->ID, 'post_grid_excerpt_count', true );
78
  $post_grid_read_more_text = get_post_meta( $post->ID, 'post_grid_read_more_text', true );
79
 
82
  $post_grid_posttype = get_post_meta( $post->ID, 'post_grid_posttype', true );
83
 
84
  $post_grid_items_width = get_post_meta( $post->ID, 'post_grid_items_width', true );
 
85
  $post_grid_thumb_height = get_post_meta( $post->ID, 'post_grid_thumb_height', true );
86
 
87
  $post_grid_meta_author_display = get_post_meta( $post->ID, 'post_grid_meta_author_display', true );
88
  $post_grid_meta_date_display = get_post_meta( $post->ID, 'post_grid_meta_date_display', true );
89
  $post_grid_meta_categories_display = get_post_meta( $post->ID, 'post_grid_meta_categories_display', true );
90
  $post_grid_meta_tags_display = get_post_meta( $post->ID, 'post_grid_meta_tags_display', true );
91
+ $post_grid_meta_comments_display = get_post_meta( $post->ID, 'post_grid_meta_comments_display', true );
92
+
93
+
94
+ $post_grid_items = get_post_meta( $post->ID, 'post_grid_items', true );
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">
102
  <div class="option-box">
103
  <p class="option-title">Shortcode</p>
104
+ <p class="option-info">Copy this shortcode and paste on page or post where you want to display post grid. <br />Use PHP code to your themes file to display post grid.</p>
105
  <textarea cols="50" rows="1" style="background:#bfefff" onClick="this.select();" >[post_grid <?php echo ' id="'.$post->ID.'"';?> ]</textarea>
106
  <br /><br />
107
  PHP Code:<br />
113
  <li nav="1" class="nav1 active">Options</li>
114
  <li nav="2" class="nav2">Style</li>
115
  <li nav="3" class="nav3">Content</li>
116
+ <li nav="4" class="nav4">Grid Builder</li>
117
  </ul> <!-- tab-nav end -->
118
 
119
  <ul class="box">
163
  <p class="option-info"></p>
164
  <select name="post_grid_themes" >
165
  <option value="flat" <?php if($post_grid_themes=="flat")echo "selected"; ?>>Flat</option>
166
+ <option value="rounded" <?php if($post_grid_themes=="rounded")echo "selected"; ?>>Rounded</option>
167
+
168
+
169
+
170
+
171
+
172
  </select>
173
  </div>
174
 
351
  </div>
352
 
353
  <div class="option-box">
354
+ <p class="option-title">Display Social Share Buttons</p>
355
  <p class="option-info"></p>
356
  <select name="post_grid_social_share_display" >
357
  <option value="yes" <?php if($post_grid_social_share_display=="yes")echo "selected"; ?>>Yes</option>
364
 
365
 
366
 
367
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
 
369
 
 
 
370
 
371
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
 
373
 
374
  <div class="option-box">
409
 
410
 
411
  <div class="option-box">
412
+ <p class="option-title">Display Comments Counts</p>
413
  <p class="option-info"></p>
414
  <select name="post_grid_meta_comments_display" >
415
  <option value="yes" <?php if($post_grid_meta_comments_display=="yes")echo "selected"; ?>>Yes</option>
423
  </li>
424
  <li style="display: none;" class="box3 tab-box ">
425
 
426
+
427
+ <div class="option-box">
428
+ <p class="option-title">Content excerpt count</p>
429
+ <p class="option-info"></p>
430
+ <input type="text" placeholder="30" name="post_grid_excerpt_count" value="<?php if(!empty($post_grid_excerpt_count)) echo $post_grid_excerpt_count; ?>" /><br />
431
+
432
+ <p class="option-title">Read more Text</p>
433
+ <p class="option-info"></p>
434
+ <input type="text" placeholder="Read More" name="post_grid_read_more_text" value="<?php if(!empty($post_grid_read_more_text)) echo $post_grid_read_more_text; else echo 'Read More'; ?>" /><br />
435
+ </div>
436
+
437
+
438
+
439
  <div class="option-box">
440
  <p class="option-title"><?php _e('Post query order','post_grid'); ?></p>
441
  <p class="option-info"></p>
457
 
458
  <option value="author" <?php if($post_grid_query_orderby=="author") echo "selected"; ?>>Author</option>
459
  <option value="title" <?php if($post_grid_query_orderby=="title") echo "selected"; ?>>Title</option>
460
+ <option value="name" <?php if($post_grid_query_orderby=="name") echo "selected"; ?>>Name</option> <option value="type" <?php if($post_grid_query_orderby=="type") echo "selected"; ?>>Type</option>
461
 
462
 
463
+
 
464
 
465
  </select>
466
  </div>
499
  }
500
  ?>
501
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
502
 
503
+ </li>
504
+ <li style="display: none;" class="box4 tab-box ">
505
+
506
+ <div class="option-box">
507
+ <p class="option-title">Grid Builder</p>
508
+ <p class="option-info"></p>
509
+
510
+
511
+ <?php
512
+ $Postgridbuilder = new PostgridClass();
513
+ echo $Postgridbuilder->settings_grid_items();
514
+
515
+ ?>
516
+
517
 
518
+ <script>
519
+ jQuery(document).ready(function($)
520
+ {
521
+ jQuery(function() {
522
+ $( ".items-container" ).sortable();
523
+ //$( ".items-container" ).disableSelection();
524
+ });
525
 
526
+ })
527
 
528
+ </script>
529
+
530
+ <script>
531
+ jQuery(document).ready(function($)
532
+ {
533
+ $( ".draggable" ).draggable();
534
+ $( ".droppable, #droppable-inner" ).droppable({
535
+ activeClass: "ui-state-hover",
536
+ hoverClass: "ui-state-active",
537
+ drop: function( event, ui ) {
538
+
539
+ var drop_item_id = ui.draggable.attr('id');
540
+ var drop_item_data_class = ui.draggable.attr('data-class');
541
+ var drop_item_title = ui.draggable.attr('title');
542
+
543
+ if(drop_item_data_class == 'saved-item')
544
+ {
545
+
546
+ }
547
+ else
548
+ {
549
+
550
+ //alert(ui.draggable.attr('id') + ' was dropped from ' + ui.draggable.parent().attr('id'));
551
+ $( this ).addClass( "ui-state-highlight" );
552
+
553
+ // Move the dragged element into its new container
554
+ ui.draggable.attr('style','position:relative');
555
+
556
+
557
+ var content = '<div id="'+drop_item_id+'" data-class="saved-item" class="saved-item draggable ui-draggable ui-draggable-handle ui-sortable-handle" style="position:relative"><div class="header">'+drop_item_title+'<span class="input-switch"><input id="switch-'+drop_item_id+'" class="switch" type="checkbox" name="post_grid_items_display['+drop_item_id+']">&nbsp;<label for="switch-'+drop_item_id+'" title="Display on grid ?">&nbsp;</label></span><span class="remove">X</span><input type="hidden" name="post_grid_items['+drop_item_id+']" value="'+drop_item_title+'" /></div><div class="options"><b>'+drop_item_title+'</b> wrapper <input placeholder="<div>" type="text" name="post_grid_wrapper['+drop_item_id+'][start]" value="" /><b>'+drop_item_title+'</b> goes here <input placeholder="</div>" type="text" name="post_grid_wrapper['+drop_item_id+'][end]" value="" /></div></div>';
558
+
559
+
560
+ $(this).children('.items-container').append(content);
561
+ }
562
+
563
 
564
+
565
+ return false;
566
+ }
567
+ });
568
+ })
569
+ </script>
570
+
571
+
572
+
573
+
574
+
575
+ </div>
576
+ </li>
577
+ </ul>
578
 
579
 
580
  </div>
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
  <?php
589
 
590
 
631
  $post_grid_thumb_size = sanitize_text_field( $_POST['post_grid_thumb_size'] );
632
  $post_grid_empty_thumb = sanitize_text_field( $_POST['post_grid_empty_thumb'] );
633
 
 
634
  $post_grid_social_share_display = sanitize_text_field( $_POST['post_grid_social_share_display'] );
635
  $post_grid_pagination_display = sanitize_text_field( $_POST['post_grid_pagination_display'] );
636
 
637
+
 
638
  $post_grid_excerpt_count = sanitize_text_field( $_POST['post_grid_excerpt_count'] );
639
  $post_grid_read_more_text = sanitize_text_field( $_POST['post_grid_read_more_text'] );
640
 
641
  $post_grid_query_order = sanitize_text_field( $_POST['post_grid_query_order'] );
642
  $post_grid_query_orderby = sanitize_text_field( $_POST['post_grid_query_orderby'] );
643
+ $post_grid_posttype = stripslashes_deep( $_POST['post_grid_posttype'] );
644
+
645
 
646
  $post_grid_items_width = sanitize_text_field( $_POST['post_grid_items_width'] );
647
+
648
  $post_grid_thumb_height = sanitize_text_field( $_POST['post_grid_thumb_height'] );
649
 
650
  $post_grid_meta_author_display = sanitize_text_field( $_POST['post_grid_meta_author_display'] );
653
  $post_grid_meta_tags_display = sanitize_text_field( $_POST['post_grid_meta_tags_display'] );
654
  $post_grid_meta_comments_display = sanitize_text_field( $_POST['post_grid_meta_comments_display'] );
655
 
 
656
 
657
+ $post_grid_items = stripslashes_deep( $_POST['post_grid_items'] );
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 );
668
 
669
  update_post_meta( $post_id, 'post_grid_thumb_size', $post_grid_thumb_size );
670
  update_post_meta( $post_id, 'post_grid_empty_thumb', $post_grid_empty_thumb );
 
671
  update_post_meta( $post_id, 'post_grid_social_share_display', $post_grid_social_share_display );
672
  update_post_meta( $post_id, 'post_grid_pagination_display', $post_grid_pagination_display );
673
+
 
 
674
  update_post_meta( $post_id, 'post_grid_excerpt_count', $post_grid_excerpt_count );
675
  update_post_meta( $post_id, 'post_grid_read_more_text', $post_grid_read_more_text );
676
 
689
  update_post_meta( $post_id, 'post_grid_meta_comments_display', $post_grid_meta_comments_display );
690
 
691
 
692
+ update_post_meta( $post_id, 'post_grid_items', $post_grid_items );
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
 
post-grid-help.php CHANGED
@@ -55,7 +55,7 @@
55
 
56
  <div class="para-settings">
57
  <ul class="tab-nav">
58
- <li nav="1" class="nav1 active">Help & Upgrade</li>
59
 
60
  </ul> <!-- tab-nav end -->
61
 
55
 
56
  <div class="para-settings">
57
  <ul class="tab-nav">
58
+ <li nav="1" class="nav1 active">Help & Support</li>
59
 
60
  </ul> <!-- tab-nav end -->
61
 
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.1
7
  Author: paratheme
8
  Author URI: http://paratheme.com
9
  License: GPLv2 or later
@@ -15,16 +15,18 @@ define('post_grid_plugin_dir', plugin_dir_path( __FILE__ ) );
15
  define('post_grid_wp_url', 'https://wordpress.org/plugins/post-grid/' );
16
  define('post_grid_wp_reviews', 'http://wordpress.org/support/view/plugin-reviews/post-grid' );
17
  define('post_grid_pro_url','http://paratheme.com/items/post-grid-awesome-grid-for-any-post-type/' );
18
- define('post_grid_demo_url', 'http://paratheme.com/demo/post-grid/?page_id=1363' );
19
  define('post_grid_conatct_url', 'http://paratheme.com/contact/' );
20
  define('post_grid_qa_url', 'http://paratheme.com/qa/' );
21
  define('post_grid_plugin_name', 'Post Grid' );
22
  define('post_grid_share_url', 'https://wordpress.org/plugins/post-grid/' );
23
  define('post_grid_tutorial_video_url', '//www.youtube.com/embed/B0sOggSp3h9fE?rel=0' );
24
 
 
 
25
  require_once( plugin_dir_path( __FILE__ ) . 'includes/post-grid-meta.php');
26
  require_once( plugin_dir_path( __FILE__ ) . 'includes/post-grid-functions.php');
27
-
28
 
29
  //Themes php files
30
 
@@ -32,11 +34,12 @@ require_once( plugin_dir_path( __FILE__ ) . 'themes/flat/index.php');
32
  require_once( plugin_dir_path( __FILE__ ) . 'themes/rounded/index.php');
33
 
34
 
 
 
35
  function post_grid_init_scripts()
36
  {
37
  wp_enqueue_script('jquery');
38
- wp_enqueue_script('post_grid_js', plugins_url( '/js/scripts.js' , __FILE__ ) , array( 'jquery' ));
39
- wp_localize_script('post_grid_js', 'post_grid_ajax', array( 'post_grid_ajaxurl' => admin_url( 'admin-ajax.php')));
40
  wp_enqueue_style('post_grid_style', post_grid_plugin_url.'css/style.css');
41
  wp_enqueue_script('masonry.pkgd.min', plugins_url( '/js/masonry.pkgd.min.js' , __FILE__ ) , array( 'jquery' ));
42
  //ParaAdmin
@@ -45,25 +48,56 @@ function post_grid_init_scripts()
45
 
46
  // Style for themes
47
  wp_enqueue_style('post-grid-style-flat', post_grid_plugin_url.'themes/flat/style.css');
48
- wp_enqueue_style('post-grid-style-rounded', post_grid_plugin_url.'themes/rounded/style.css');
49
 
50
 
51
  }
52
  add_action("init","post_grid_init_scripts");
53
 
54
 
55
- // to work upload button on user profile
56
- add_action( 'admin_enqueue_scripts', 'wp_enqueue_media' );
57
 
58
 
59
 
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  register_activation_hook(__FILE__, 'post_grid_activation');
62
 
63
 
64
  function post_grid_activation()
65
  {
66
- $post_grid_version= "1.1";
67
  update_option('post_grid_version', $post_grid_version); //update plugin version.
68
 
69
  $post_grid_customer_type= "free"; //customer_type "free"
@@ -94,15 +128,17 @@ function post_grid_display($atts, $content = null ) {
94
  elseif($post_grid_themes== "rounded")
95
  {
96
  $html.= post_grid_themes_rounded($post_id);
97
- }
 
98
  else
99
  {
100
  $html.= post_grid_themes_flat($post_id);
101
  }
102
 
103
-
104
 
105
- return $html;
 
 
106
 
107
 
108
 
@@ -119,9 +155,11 @@ function post_grid_menu_help(){
119
  include('post-grid-help.php');
120
  }
121
 
 
 
 
122
  function post_grid_menu_init() {
123
- add_submenu_page('edit.php?post_type=post_grid', __('Help','post_grid'), __('Help','post_grid'), 'manage_options', 'post_grid_menu_help', 'post_grid_menu_help');
124
-
125
 
126
  }
127
 
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.2
7
  Author: paratheme
8
  Author URI: http://paratheme.com
9
  License: GPLv2 or later
15
  define('post_grid_wp_url', 'https://wordpress.org/plugins/post-grid/' );
16
  define('post_grid_wp_reviews', 'http://wordpress.org/support/view/plugin-reviews/post-grid' );
17
  define('post_grid_pro_url','http://paratheme.com/items/post-grid-awesome-grid-for-any-post-type/' );
18
+ define('post_grid_demo_url', 'http://paratheme.com/demo/post-grid/' );
19
  define('post_grid_conatct_url', 'http://paratheme.com/contact/' );
20
  define('post_grid_qa_url', 'http://paratheme.com/qa/' );
21
  define('post_grid_plugin_name', 'Post Grid' );
22
  define('post_grid_share_url', 'https://wordpress.org/plugins/post-grid/' );
23
  define('post_grid_tutorial_video_url', '//www.youtube.com/embed/B0sOggSp3h9fE?rel=0' );
24
 
25
+
26
+
27
  require_once( plugin_dir_path( __FILE__ ) . 'includes/post-grid-meta.php');
28
  require_once( plugin_dir_path( __FILE__ ) . 'includes/post-grid-functions.php');
29
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/PostGridClass.php');
30
 
31
  //Themes php files
32
 
34
  require_once( plugin_dir_path( __FILE__ ) . 'themes/rounded/index.php');
35
 
36
 
37
+
38
+
39
  function post_grid_init_scripts()
40
  {
41
  wp_enqueue_script('jquery');
42
+
 
43
  wp_enqueue_style('post_grid_style', post_grid_plugin_url.'css/style.css');
44
  wp_enqueue_script('masonry.pkgd.min', plugins_url( '/js/masonry.pkgd.min.js' , __FILE__ ) , array( 'jquery' ));
45
  //ParaAdmin
48
 
49
  // Style for themes
50
  wp_enqueue_style('post-grid-style-flat', post_grid_plugin_url.'themes/flat/style.css');
51
+ wp_enqueue_style('post-grid-style-rounded', post_grid_plugin_url.'themes/rounded/style.css');
52
 
53
 
54
  }
55
  add_action("init","post_grid_init_scripts");
56
 
57
 
 
 
58
 
59
 
60
 
61
 
62
+
63
+
64
+
65
+ function post_grid_admin_scripts()
66
+ {
67
+ wp_enqueue_script('jquery');
68
+ wp_enqueue_script('jquery-ui-core');
69
+ wp_enqueue_script('jquery-ui-sortable');
70
+ wp_enqueue_script('jquery-ui-droppable');
71
+
72
+ wp_enqueue_script('post_grid_admin_js', plugins_url( '/admin/js/scripts.js' , __FILE__ ) , array( 'jquery' ));
73
+
74
+ wp_enqueue_style('post_grid_admin_style', post_grid_plugin_url.'admin/css/style.css');
75
+
76
+ //ParaAdmin
77
+ wp_enqueue_style('ParaAdmin', post_grid_plugin_url.'ParaAdmin/css/ParaAdmin.css');
78
+ //wp_enqueue_style('ParaIcons', post_grid_plugin_url.'ParaAdmin/css/ParaIcons.css');
79
+ wp_enqueue_script('ParaAdmin', plugins_url( 'ParaAdmin/js/ParaAdmin.js' , __FILE__ ) , array( 'jquery' ));
80
+
81
+
82
+
83
+ }
84
+
85
+
86
+
87
+ add_action( 'admin_enqueue_scripts', 'post_grid_admin_scripts' );
88
+
89
+
90
+
91
+ // to work upload button on user profile
92
+ add_action( 'admin_enqueue_scripts', 'wp_enqueue_media' );
93
+
94
+
95
  register_activation_hook(__FILE__, 'post_grid_activation');
96
 
97
 
98
  function post_grid_activation()
99
  {
100
+ $post_grid_version= "1.2";
101
  update_option('post_grid_version', $post_grid_version); //update plugin version.
102
 
103
  $post_grid_customer_type= "free"; //customer_type "free"
128
  elseif($post_grid_themes== "rounded")
129
  {
130
  $html.= post_grid_themes_rounded($post_id);
131
+ }
132
+
133
  else
134
  {
135
  $html.= post_grid_themes_flat($post_id);
136
  }
137
 
 
138
 
139
+ return $html;
140
+
141
+
142
 
143
 
144
 
155
  include('post-grid-help.php');
156
  }
157
 
158
+
159
+
160
+
161
  function post_grid_menu_init() {
162
+ add_submenu_page('edit.php?post_type=post_grid', __('Help','post_grid'), __('Help','post_grid'), 'manage_options', 'post_grid_menu_help', 'post_grid_menu_help');
 
163
 
164
  }
165
 
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.1
7
- Stable tag: 1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -19,9 +19,8 @@ Use any where by short-codes and easy customize via short-code generator page, y
19
 
20
  ### Post Grid by http://paratheme.com
21
 
22
- * [Buy Premium! &raquo;](http://paratheme.com/items/post-grid-awesome-grid-for-any-post-type/)
23
  * [See the Live demo!&raquo;](http://paratheme.com/demo/post-grid/)
24
-
25
 
26
 
27
  <strong>Plugin Features</strong><br />
@@ -43,7 +42,15 @@ Use any where by short-codes and easy customize via short-code generator page, y
43
  <strong>Premium Features</strong><br />
44
 
45
  * Query post from taxonomy & terms.
46
- * Total 4 different layout.
 
 
 
 
 
 
 
 
47
 
48
 
49
  == Installation ==
@@ -71,10 +78,16 @@ then paste this shortcode anywhere in your page to display grid<br />
71
 
72
  1. screenshot-1
73
  2. screenshot-2
 
 
 
74
 
75
  == Changelog ==
76
 
77
 
 
 
 
78
 
79
  = 1.1 =
80
  * 03/03/2015 add- option for display/hide social share buttons.
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.1.1
7
+ Stable tag: 1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
19
 
20
  ### Post Grid by http://paratheme.com
21
 
 
22
  * [See the Live demo!&raquo;](http://paratheme.com/demo/post-grid/)
23
+ * [Buy Premium! &raquo;](http://paratheme.com/items/post-grid-awesome-grid-for-any-post-type/)
24
 
25
 
26
  <strong>Plugin Features</strong><br />
42
  <strong>Premium Features</strong><br />
43
 
44
  * Query post from taxonomy & terms.
45
+ * WooCommerce ready
46
+ * Display Meta Fields on gird.
47
+
48
+ <strong>Video Tutorial(with pro version interface)</strong><br />
49
+ https://www.youtube.com/watch?v=JsDfu6LXtj4
50
+
51
+
52
+
53
+
54
 
55
 
56
  == Installation ==
78
 
79
  1. screenshot-1
80
  2. screenshot-2
81
+ 3. screenshot-3
82
+ 4. screenshot-4
83
+ 5. screenshot-5
84
 
85
  == Changelog ==
86
 
87
 
88
+ = 1.2 =
89
+ * 05/03/2015 remove- removed some options.
90
+ * 05/03/2015 add- grid layout builder.
91
 
92
  = 1.1 =
93
  * 03/03/2015 add- option for display/hide social share buttons.
themes/flat/index.php CHANGED
@@ -12,23 +12,21 @@ function post_grid_themes_flat($post_id)
12
  $post_grid_empty_thumb = get_post_meta( $post_id, 'post_grid_empty_thumb', true );
13
 
14
  $post_grid_post_per_page = get_post_meta( $post_id, 'post_grid_post_per_page', true );
15
- $post_grid_social_share_position = get_post_meta( $post_id, 'post_grid_social_share_position', true );
16
  $post_grid_social_share_display = get_post_meta( $post_id, 'post_grid_social_share_display', true );
17
  $post_grid_pagination_display = get_post_meta( $post_id, 'post_grid_pagination_display', true );
18
-
19
- $post_grid_read_more_position = get_post_meta( $post_id, 'post_grid_read_more_position', true );
20
- $post_grid_read_more_hov_in_style = get_post_meta( $post_id, 'post_grid_read_more_hov_in_style', true );
21
  $post_grid_excerpt_count = get_post_meta( $post_id, 'post_grid_excerpt_count', true );
22
  $post_grid_read_more_text = get_post_meta( $post_id, 'post_grid_read_more_text', true );
23
 
24
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
25
- $post_grid_items_width = get_post_meta( $post_id, 'post_grid_items_width', true );
26
- //$post_grid_thumb_width = get_post_meta( $post_id, 'post_grid_thumb_width', true );
27
  $post_grid_thumb_height = get_post_meta( $post_id, 'post_grid_thumb_height', true );
28
 
29
  $post_grid_query_order = get_post_meta( $post_id, 'post_grid_query_order', true );
30
  $post_grid_query_orderby = get_post_meta( $post_id, 'post_grid_query_orderby', true );
31
  $post_grid_posttype = get_post_meta( $post_id, 'post_grid_posttype', true );
 
 
32
 
33
  $post_grid_meta_author_display = get_post_meta( $post_id, 'post_grid_meta_author_display', true );
34
  $post_grid_meta_date_display = get_post_meta( $post_id, 'post_grid_meta_date_display', true );
@@ -36,6 +34,40 @@ function post_grid_themes_flat($post_id)
36
  $post_grid_meta_tags_display = get_post_meta( $post_id, 'post_grid_meta_tags_display', true );
37
  $post_grid_meta_comments_display = get_post_meta( $post_id, 'post_grid_meta_comments_display', true );
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  if(empty($post_grid_read_more_text))
40
  {
41
  $post_grid_read_more_text = 'Read More.';
@@ -53,118 +85,334 @@ function post_grid_themes_flat($post_id)
53
  $html .= '<div class="post-grid-container post-grid-container-'.$post_id.' '.$post_grid_themes.' " >';
54
  $html .= '<div class="post-grid-items" >';
55
 
56
- $wp_query = new WP_Query(
57
- array (
58
- 'post_type' => $post_grid_posttype,
59
- 'post_status' => 'publish',
60
- 'orderby' => $post_grid_query_orderby,
61
- 'order' => $post_grid_query_order,
62
- 'posts_per_page' => $post_grid_post_per_page,
63
- 'paged' => get_query_var( 'paged' )
64
- ) );
65
-
66
- if ( $wp_query->have_posts() ) :
67
-
68
- while ( $wp_query->have_posts() ) : $wp_query->the_post();
69
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), $post_grid_thumb_size );
70
- $thumb_url = $thumb['0'];
71
-
72
-
73
- if(empty($thumb_url))
74
  {
75
- $thumb_url = $post_grid_empty_thumb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
-
78
-
79
- $html .= '<div class="grid-single" style="max-width:'.$post_grid_items_width.';" >';
80
- $html .= '<div class="thumb" style="max-height:'.$post_grid_thumb_height.';" ><img src="'.$thumb_url.'" />';
81
-
82
- $html .= '<div class="link '.$post_grid_read_more_position.' '.$post_grid_read_more_hov_in_style.'" ><a href="'.get_the_permalink().'">'.$post_grid_read_more_text.'</a></div >';
83
-
84
-
85
- if($post_grid_social_share_display=='yes')
86
  {
87
- $html .= '<div class="social-icon '.$post_grid_social_share_position.'" >
88
- <span class="fb">
89
- <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"> </a>
90
- </span>
91
- <span class="twitter">
92
- <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"></a>
93
- </span>
94
- <span class="gplus">
95
- <a target="_blank" href="https://plus.google.com/share?url='.get_permalink().'"></a>
96
- </span>
97
- </div >';
98
  }
99
 
 
100
 
101
-
102
-
103
- $html .= '</div>';
104
-
105
 
106
 
107
 
108
- $categories = get_the_category();
109
- $separator = ', ';
110
- $category_output = '';
111
- if($categories){
112
- foreach($categories as $category) {
113
- $category_output .= '<a href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$separator;
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
- }
117
-
118
- $tags = get_the_tags(get_the_ID());
119
- if(empty($tags))
120
- {
121
- $tags = array();
122
- }
123
- $tags_links = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
- foreach ($tags as $tag)
126
- {
127
- $tags_links .= '<a href="'.get_tag_link($tag->term_id).'" >#'.$tag->name.'</a> ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
- }
130
-
131
-
132
- $total_comments = wp_count_comments( get_the_ID() );
133
-
134
- $html .= '<div class="meta" >';
135
-
136
- if($post_grid_meta_date_display == 'yes')
137
- $html .= '<span class="date">'.get_the_date('M d Y').'</span>';
138
-
139
- if($post_grid_meta_author_display == 'yes')
140
- $html .= '<span class="author">'.get_the_author().'</span>';
141
-
142
- if(!empty($category_output) && $post_grid_meta_categories_display == 'yes')
143
- $html .= '<span class="cayegory">'.trim($category_output, $separator).'</span>';
144
-
145
- if(!empty($tags_links) && $post_grid_meta_tags_display == 'yes')
146
- $html .= '<span class="tags">'.$tags_links.'</span>';
147
-
148
- if($post_grid_meta_comments_display == 'yes')
149
- $html .= '<span class="comments">'.$total_comments->approved.'</span>';
150
-
151
- $html .= '</div >';
152
 
153
-
154
- $html .= '<div class="title" >'.get_the_title().'</div >';
155
-
156
- $content = get_the_content();
157
- $content = wp_trim_words( $content , $post_grid_excerpt_count, ' <a class="read-more" href="'.get_the_permalink().'">'.$post_grid_read_more_text.'</a>' );
158
-
159
-
160
- $html .= '<div class="content" >'.$content.'</div >';
 
 
 
 
 
 
 
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
 
164
-
165
-
166
-
167
- $html .= '</div >';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  endwhile;
169
 
170
 
12
  $post_grid_empty_thumb = get_post_meta( $post_id, 'post_grid_empty_thumb', true );
13
 
14
  $post_grid_post_per_page = get_post_meta( $post_id, 'post_grid_post_per_page', true );
 
15
  $post_grid_social_share_display = get_post_meta( $post_id, 'post_grid_social_share_display', true );
16
  $post_grid_pagination_display = get_post_meta( $post_id, 'post_grid_pagination_display', true );
17
+
 
 
18
  $post_grid_excerpt_count = get_post_meta( $post_id, 'post_grid_excerpt_count', true );
19
  $post_grid_read_more_text = get_post_meta( $post_id, 'post_grid_read_more_text', true );
20
 
21
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
22
+ $post_grid_items_width = get_post_meta( $post_id, 'post_grid_items_width', true );
 
23
  $post_grid_thumb_height = get_post_meta( $post_id, 'post_grid_thumb_height', true );
24
 
25
  $post_grid_query_order = get_post_meta( $post_id, 'post_grid_query_order', true );
26
  $post_grid_query_orderby = get_post_meta( $post_id, 'post_grid_query_orderby', true );
27
  $post_grid_posttype = get_post_meta( $post_id, 'post_grid_posttype', true );
28
+ $post_grid_taxonomy = get_post_meta( $post_id, 'post_grid_taxonomy', true );
29
+ $post_grid_taxonomy_category = get_post_meta( $post_id, 'post_grid_taxonomy_category', true );
30
 
31
  $post_grid_meta_author_display = get_post_meta( $post_id, 'post_grid_meta_author_display', true );
32
  $post_grid_meta_date_display = get_post_meta( $post_id, 'post_grid_meta_date_display', true );
34
  $post_grid_meta_tags_display = get_post_meta( $post_id, 'post_grid_meta_tags_display', true );
35
  $post_grid_meta_comments_display = get_post_meta( $post_id, 'post_grid_meta_comments_display', true );
36
 
37
+ $post_grid_items = get_post_meta( $post_id, 'post_grid_items', true );
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',
44
+ 'content'=>'Content',
45
+ 'thumbnail'=>'Thumbnail',
46
+ 'meta'=>'Meta',
47
+ 'social'=>'Social',
48
+ 'hover_items'=>'Hover Items',
49
+ 'woocommerce'=>'WooCommerce'
50
+ );
51
+ }
52
+
53
+ if(empty($post_grid_items_display))
54
+ {
55
+ $post_grid_items_display = array('post_title'=>'on',
56
+ 'content'=>'on',
57
+ 'thumbnail'=>'on',
58
+ 'meta'=>'on',
59
+ 'social'=>'on',
60
+ 'hover_items'=>'on',
61
+ 'woocommerce'=>'on'
62
+ );
63
+ }
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
  if(empty($post_grid_read_more_text))
72
  {
73
  $post_grid_read_more_text = 'Read More.';
85
  $html .= '<div class="post-grid-container post-grid-container-'.$post_id.' '.$post_grid_themes.' " >';
86
  $html .= '<div class="post-grid-items" >';
87
 
88
+ if(!empty($post_grid_taxonomy))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  {
90
+ $wp_query = new WP_Query(
91
+ array (
92
+ 'post_type' => $post_grid_posttype,
93
+ 'post_status' => 'publish',
94
+ 'tax_query' => array(
95
+ array(
96
+ 'taxonomy' => $post_grid_taxonomy,
97
+ 'field' => 'id',
98
+ 'terms' => $post_grid_taxonomy_category,
99
+ )
100
+ ),
101
+
102
+ 'orderby' => $post_grid_query_orderby,
103
+ 'order' => $post_grid_query_order,
104
+ 'posts_per_page' => $post_grid_post_per_page,
105
+ 'paged' => get_query_var( 'paged' )
106
+ ) );
107
  }
108
+ else
 
 
 
 
 
 
 
 
109
  {
110
+ $wp_query = new WP_Query(
111
+ array (
112
+ 'post_type' => $post_grid_posttype,
113
+ 'post_status' => 'publish',
114
+ 'orderby' => $post_grid_query_orderby,
115
+ 'order' => $post_grid_query_order,
116
+ 'posts_per_page' => $post_grid_post_per_page,
117
+ 'paged' => get_query_var( 'paged' )
118
+ ) );
 
 
119
  }
120
 
121
+ if ( $wp_query->have_posts() ) :
122
 
123
+ while ( $wp_query->have_posts() ) : $wp_query->the_post();
 
 
 
124
 
125
 
126
 
127
+ $html .= '<div class="grid-single" style="max-width:'.$post_grid_items_width.';" >';
128
+ foreach($post_grid_items as $key=>$items)
129
+ {
130
+ if($key == 'post_title')
131
+ {
132
+ if(!empty($post_grid_items_display[$key]))
133
+ {
134
+ if(!empty($post_grid_wrapper[$key]['start']))
135
+ {
136
+ $html .=$post_grid_wrapper[$key]['start'];
137
+ }
138
+ else
139
+ {
140
+ $html .= '<div class="title">';
141
+ }
142
+
143
+ $html .= get_the_title();
144
+
145
+ if(!empty($post_grid_wrapper[$key]['end']))
146
+ {
147
+ $html .=$post_grid_wrapper[$key]['end'];
148
+ }
149
+ else
150
+ {
151
+ $html .= '</div >';
152
+ }
153
 
154
+ }
155
+
156
+ }
157
+ elseif($key == 'content')
158
+ {
159
+ if(!empty($post_grid_items_display[$key]))
160
+ {
161
+ $content = get_the_content();
162
+ $content = wp_trim_words( $content , $post_grid_excerpt_count, ' <a class="read-more" href="'.get_the_permalink().'">'.$post_grid_read_more_text.'</a>' );
163
+
164
+ if(!empty($post_grid_wrapper[$key]['start']))
165
+ {
166
+
167
+ $html .=$post_grid_wrapper[$key]['start'];
168
+ }
169
+ else
170
+ {
171
+ $html .= '<div class="content">';
172
+ }
173
+
174
+ $html .= $content;
175
+
176
+ if(!empty($post_grid_wrapper[$key]['end']))
177
+ {
178
+
179
+ $html .=$post_grid_wrapper[$key]['end'];
180
+ }
181
+ else
182
+ {
183
+ $html .= '</div >';
184
+ }
185
+
186
+
187
+
188
+ }
189
 
190
+ }
191
+ elseif($key == 'thumbnail')
192
+ {
193
+
194
+ if(!empty($post_grid_items_display[$key]))
195
+ {
196
+ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), $post_grid_thumb_size );
197
+ $thumb_url = $thumb['0'];
198
+
199
+ if(empty($thumb_url))
200
+ {
201
+ $thumb_url = $post_grid_empty_thumb;
202
+ }
203
+
204
+ if(!empty($post_grid_wrapper[$key]['start']))
205
+ {
206
+ $html .=$post_grid_wrapper[$key]['start'];
207
+ }
208
+ else
209
+ {
210
+ $html .= '<div class="thumb" style="max-height:'.$post_grid_thumb_height.';" >';
211
+ }
212
+
213
+
214
+ $html .= '<img src="'.$thumb_url.'" />';
215
+
216
+ if(!empty($post_grid_wrapper[$key]['end']))
217
+ {
218
+ $html .=$post_grid_wrapper[$key]['end'];
219
+ }
220
+ else
221
+ {
222
+ $html .= '</div >';
223
+ }
224
+
225
+
226
+ }
227
+
228
+
229
+ }
230
+ elseif($key == 'meta')
231
+ {
232
+ if(!empty($post_grid_items_display[$key]))
233
+ {
234
+
235
+ if(!empty($post_grid_wrapper[$key]['start']))
236
+ {
237
+ $html .=$post_grid_wrapper[$key]['start'];
238
+ }
239
+ else
240
+ {
241
+ $html .= '<div class="meta">';
242
+ }
243
+
244
+
245
+
246
+ if($post_grid_meta_date_display == 'yes')
247
+ $html .= '<span class="date">'.get_the_date('M d Y').'</span>';
248
+
249
+ if($post_grid_meta_author_display == 'yes')
250
+ $html .= '<span class="author">'.get_the_author().'</span>';
251
+
252
+ if(!empty($category_output) && $post_grid_meta_categories_display == 'yes')
253
+ $html .= '<span class="cayegory">'.trim($category_output, $separator).'</span>';
254
+
255
+ if(!empty($tags_links) && $post_grid_meta_tags_display == 'yes')
256
+ $html .= '<span class="tags">'.$tags_links.'</span>';
257
+
258
+ $total_comments = wp_count_comments( get_the_ID() );
259
+ if($post_grid_meta_comments_display == 'yes')
260
+ $html .= '<span class="comments">'.$total_comments->approved.'</span>';
261
+
262
+
263
+ if(!empty($post_grid_wrapper[$key]['end']))
264
+ {
265
+ $html .=$post_grid_wrapper[$key]['end'];
266
+ }
267
+ else
268
+ {
269
+ $html .= '</div >';
270
+ }
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+ }
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
 
281
+ }
282
+ elseif($key == 'social')
283
+ {
284
+ if(!empty($post_grid_items_display[$key]))
285
+ {
286
+
287
+
288
+ if(!empty($post_grid_wrapper[$key]['start']))
289
+ {
290
+ $html .=$post_grid_wrapper[$key]['start'];
291
+ }
292
+ else
293
+ {
294
+ $html .= '<div class="social-icon">';
295
+ }
296
 
297
+
298
+ $html .= '
299
+ <span class="fb">
300
+ <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"> </a>
301
+ </span>
302
+ <span class="twitter">
303
+ <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"></a>
304
+ </span>
305
+ <span class="gplus">
306
+ <a target="_blank" href="https://plus.google.com/share?url='.get_permalink().'"></a>
307
+ </span>
308
+ ';
309
+
310
+
311
+ if(!empty($post_grid_wrapper[$key]['end']))
312
+ {
313
+ $html .=$post_grid_wrapper[$key]['end'];
314
+ }
315
+ else
316
+ {
317
+ $html .= '</div >';
318
+ }
319
+
320
+
321
+
322
+
323
+
324
+ }
325
+
326
+
327
+
328
+ }
329
 
330
 
331
+ if($key == 'hover_items')
332
+ {
333
+ if(!empty($post_grid_items_display[$key]))
334
+ {
335
+ if(!empty($post_grid_wrapper[$key]['start']))
336
+ {
337
+ $html .=$post_grid_wrapper[$key]['start'];
338
+ }
339
+ else
340
+ {
341
+ $html .= '<div class="hover-items">';
342
+ }
343
+
344
+ //$html .= '<a title="Zoom." class="zoom"></a>';
345
+ $html .= '<a title="Read More." href="'.get_the_permalink().'" class="post-link"></a>';
346
+
347
+ if(!empty($post_grid_wrapper[$key]['end']))
348
+ {
349
+ $html .=$post_grid_wrapper[$key]['end'];
350
+ }
351
+ else
352
+ {
353
+ $html .= '</div >';
354
+ }
355
+
356
+ }
357
+
358
+ }
359
+
360
+ if($key == 'woocommerce')
361
+ {
362
+
363
+ $is_product = get_post_type( get_the_ID() );
364
+ $active_plugins = get_option('active_plugins');
365
+
366
+ if(in_array( 'woocommerce/woocommerce.php', (array) $active_plugins ) && $is_product=='product')
367
+ {
368
+ if(!empty($post_grid_items_display[$key]))
369
+ {
370
+ if(!empty($post_grid_wrapper[$key]['start']))
371
+ {
372
+ $html .=$post_grid_wrapper[$key]['start'];
373
+ }
374
+ else
375
+ {
376
+ $html .= '<div class="pg-woocommerce">';
377
+ }
378
+
379
+ global $woocommerce, $product;
380
+
381
+ $price = $product->get_price_html();
382
+ $cart = do_shortcode('[add_to_cart id="'.get_the_ID().'"]');
383
+ $rating = $product->get_average_rating();
384
+ $rating = (($rating/5)*100);
385
+ $html .= '<div class="pg-price">'.$price.'</div>';
386
+ $html .= '<div class="pg-cart">'.$cart.'</div>';
387
+ $html .= '<div class="pg-rating woocommerce"><div class="woocommerce-product-rating"><div class="star-rating" title="Rated '.$rating.'"><span style="width:'.$rating.'%;"></span></div></div></div>';
388
+
389
+ if(!empty($post_grid_wrapper[$key]['end']))
390
+ {
391
+ $html .=$post_grid_wrapper[$key]['end'];
392
+ }
393
+ else
394
+ {
395
+ $html .= '</div >';
396
+ }
397
+
398
+ }
399
+ }
400
+
401
+
402
+
403
+
404
+ }
405
+
406
+
407
+
408
+ else
409
+ {
410
+
411
+ }
412
+
413
+ }
414
+ $html .= '</div >';
415
+
416
  endwhile;
417
 
418
 
themes/flat/style.css CHANGED
@@ -7,10 +7,12 @@
7
  }
8
 
9
  .post-grid-container.flat .grid-single {
 
10
  display: inline-block;
11
- margin: 40px 15px;
12
  max-width: 250px;
13
  padding: 0;
 
14
  text-align: center;
15
  vertical-align: top;
16
  }
@@ -31,18 +33,62 @@
31
  .post-grid-container.flat .title {
32
  font-size: 15px;
33
  font-weight: bold;
34
- padding: 15px 0;
35
  text-align: left;
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  .post-grid-container.flat .content {
39
  font-size: 13px;
40
  line-height: inherit;
 
41
  text-align: left;
42
  }
43
 
44
- .post-grid-container.flat .content .read-more{
45
- text-decoration:none;
 
46
  }
47
 
48
 
7
  }
8
 
9
  .post-grid-container.flat .grid-single {
10
+ background: none repeat scroll 0 0 rgb(255, 255, 255);
11
  display: inline-block;
12
+ margin: 20px 15px;
13
  max-width: 250px;
14
  padding: 0;
15
+ position: relative;
16
  text-align: center;
17
  vertical-align: top;
18
  }
33
  .post-grid-container.flat .title {
34
  font-size: 15px;
35
  font-weight: bold;
36
+ padding: 10px;
37
  text-align: left;
38
  }
39
+ .post-grid-container.flat .meta {
40
+ padding: 10px;
41
+ }
42
+
43
+
44
+
45
+
46
+
47
+ .post-grid-container.flat .pg-woocommerce {
48
+ padding: 10px;
49
+ }
50
+
51
+ .post-grid-container.flat .pg-price {
52
+
53
+
54
+ }
55
+ .post-grid-container.flat .pg-price .amount {
56
+ font-size: 18px;
57
+ }
58
+
59
+ .post-grid-container.flat .pg-cart {
60
+
61
+ }
62
+ .post-grid-container.flat .pg-cart p {
63
+ border: medium none !important;
64
+ margin-bottom: 0 !important;
65
+ padding: 10px 0 !important;
66
+ }
67
+ .post-grid-container.flat .pg-cart .amount {
68
+ display: none;
69
+ }
70
+
71
+ .post-grid-container.flat .pg-rating {
72
+ padding: 10px 0;
73
+ }
74
+
75
+
76
+ .post-grid-container.flat .pg-rating .star-rating {
77
+ float: none !important;
78
+ margin: 0 auto;
79
+ }
80
+
81
 
82
  .post-grid-container.flat .content {
83
  font-size: 13px;
84
  line-height: inherit;
85
+ padding: 10px;
86
  text-align: left;
87
  }
88
 
89
+ .post-grid-container.flat .content .read-more {
90
+ font-weight: bold;
91
+ text-decoration: none;
92
  }
93
 
94
 
themes/rounded/index.php CHANGED
@@ -12,21 +12,21 @@ function post_grid_themes_rounded($post_id)
12
  $post_grid_empty_thumb = get_post_meta( $post_id, 'post_grid_empty_thumb', true );
13
 
14
  $post_grid_post_per_page = get_post_meta( $post_id, 'post_grid_post_per_page', true );
15
- $post_grid_social_share_position = get_post_meta( $post_id, 'post_grid_social_share_position', true );
16
  $post_grid_social_share_display = get_post_meta( $post_id, 'post_grid_social_share_display', true );
17
  $post_grid_pagination_display = get_post_meta( $post_id, 'post_grid_pagination_display', true );
18
-
19
- $post_grid_read_more_position = get_post_meta( $post_id, 'post_grid_read_more_position', true );
20
- $post_grid_read_more_hov_in_style = get_post_meta( $post_id, 'post_grid_read_more_hov_in_style', true );
21
  $post_grid_excerpt_count = get_post_meta( $post_id, 'post_grid_excerpt_count', true );
22
  $post_grid_read_more_text = get_post_meta( $post_id, 'post_grid_read_more_text', true );
23
 
24
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
25
- $post_grid_items_width = get_post_meta( $post_id, 'post_grid_items_width', true );
26
- //$post_grid_thumb_width = get_post_meta( $post_id, 'post_grid_thumb_width', true );
27
  $post_grid_thumb_height = get_post_meta( $post_id, 'post_grid_thumb_height', true );
28
 
 
 
29
  $post_grid_posttype = get_post_meta( $post_id, 'post_grid_posttype', true );
 
 
30
 
31
  $post_grid_meta_author_display = get_post_meta( $post_id, 'post_grid_meta_author_display', true );
32
  $post_grid_meta_date_display = get_post_meta( $post_id, 'post_grid_meta_date_display', true );
@@ -34,6 +34,38 @@ function post_grid_themes_rounded($post_id)
34
  $post_grid_meta_tags_display = get_post_meta( $post_id, 'post_grid_meta_tags_display', true );
35
  $post_grid_meta_comments_display = get_post_meta( $post_id, 'post_grid_meta_comments_display', true );
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  if(empty($post_grid_read_more_text))
39
  {
@@ -52,119 +84,334 @@ function post_grid_themes_rounded($post_id)
52
  $html .= '<div class="post-grid-container post-grid-container-'.$post_id.' '.$post_grid_themes.' " >';
53
  $html .= '<div class="post-grid-items" >';
54
 
55
- $wp_query = new WP_Query(
56
- array (
57
- 'post_type' => $post_grid_posttype,
58
- 'post_status' => 'publish',
59
- 'posts_per_page' => $post_grid_post_per_page,
60
- 'paged' => get_query_var( 'paged' )
61
-
62
- ) );
63
-
64
- if ( $wp_query->have_posts() ) :
65
-
66
- while ( $wp_query->have_posts() ) : $wp_query->the_post();
67
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), $post_grid_thumb_size );
68
- $thumb_url = $thumb['0'];
69
-
70
- if(empty($thumb_url))
71
  {
72
- $thumb_url = $post_grid_empty_thumb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
-
75
- $html .= '<div class="grid-single" style="max-width:'.$post_grid_items_width.';" >';
76
- $html .= '<div class="thumb" style=" width:'.$post_grid_items_width.';height:'.$post_grid_items_width.';" ><img src="'.$thumb_url.'" />';
77
-
78
- $html .= '<div class="link '.$post_grid_read_more_position.' '.$post_grid_read_more_hov_in_style.'" ><a href="'.get_the_permalink().'">'.$post_grid_read_more_text.'</a></div >';
79
-
80
-
81
- if($post_grid_social_share_display=='yes')
82
  {
83
- $html .= '<div class="social-icon '.$post_grid_social_share_position.'" >
84
- <span class="fb">
85
- <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"> </a>
86
- </span>
87
- <span class="twitter">
88
- <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"></a>
89
- </span>
90
- <span class="gplus">
91
- <a target="_blank" href="https://plus.google.com/share?url='.get_permalink().'"></a>
92
- </span>
93
- </div >';
94
  }
95
 
 
96
 
97
-
98
-
99
- $html .= '</div>';
100
-
101
 
102
 
103
 
104
- $categories = get_the_category();
105
- $separator = ', ';
106
- $category_output = '';
107
- if($categories){
108
- foreach($categories as $category) {
109
- $category_output .= '<a href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$separator;
110
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
- }
113
-
114
- $tags = get_the_tags(get_the_ID());
115
- if(empty($tags))
116
- {
117
- $tags = array();
118
- }
119
- $tags_links = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
 
121
- foreach ($tags as $tag)
122
- {
123
- $tags_links .= '<a href="'.get_tag_link($tag->term_id).'" >#'.$tag->name.'</a> ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
- }
126
-
127
-
128
- $total_comments = wp_count_comments( get_the_ID() );
129
-
130
- $html .= '<div class="meta" >';
131
-
132
- if($post_grid_meta_date_display == 'yes')
133
- $html .= '<span class="date">'.get_the_date('M d Y').'</span>';
134
-
135
- if($post_grid_meta_author_display == 'yes')
136
- $html .= '<span class="author">'.get_the_author().'</span>';
137
-
138
- if(!empty($category_output) && $post_grid_meta_categories_display == 'yes')
139
- $html .= '<span class="cayegory">'.trim($category_output, $separator).'</span>';
140
-
141
- if(!empty($tags_links) && $post_grid_meta_tags_display == 'yes')
142
- $html .= '<span class="tags">'.$tags_links.'</span>';
143
-
144
- if($post_grid_meta_comments_display == 'yes')
145
- $html .= '<span class="comments">'.$total_comments->approved.'</span>';
146
-
147
- $html .= '</div >';
148
 
149
-
150
- $html .= '<div class="title" >'.get_the_title().'</div >';
151
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
- $content = get_the_content();
155
- $content = wp_trim_words( $content , $post_grid_excerpt_count, ' <a class="read-more" href="'.get_the_permalink().'">'.$post_grid_read_more_text.'</a>' );
156
-
157
-
158
-
159
-
160
- $html .= '<div class="content" >'.$content.'</div >';
161
 
 
 
162
 
163
 
164
-
165
-
166
-
167
- $html .= '</div >';
 
 
 
 
 
168
  endwhile;
169
 
170
  $html .= '</div >';
12
  $post_grid_empty_thumb = get_post_meta( $post_id, 'post_grid_empty_thumb', true );
13
 
14
  $post_grid_post_per_page = get_post_meta( $post_id, 'post_grid_post_per_page', true );
 
15
  $post_grid_social_share_display = get_post_meta( $post_id, 'post_grid_social_share_display', true );
16
  $post_grid_pagination_display = get_post_meta( $post_id, 'post_grid_pagination_display', true );
17
+
 
 
18
  $post_grid_excerpt_count = get_post_meta( $post_id, 'post_grid_excerpt_count', true );
19
  $post_grid_read_more_text = get_post_meta( $post_id, 'post_grid_read_more_text', true );
20
 
21
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
22
+ $post_grid_items_width = get_post_meta( $post_id, 'post_grid_items_width', true );
 
23
  $post_grid_thumb_height = get_post_meta( $post_id, 'post_grid_thumb_height', true );
24
 
25
+ $post_grid_query_order = get_post_meta( $post_id, 'post_grid_query_order', true );
26
+ $post_grid_query_orderby = get_post_meta( $post_id, 'post_grid_query_orderby', true );
27
  $post_grid_posttype = get_post_meta( $post_id, 'post_grid_posttype', true );
28
+ $post_grid_taxonomy = get_post_meta( $post_id, 'post_grid_taxonomy', true );
29
+ $post_grid_taxonomy_category = get_post_meta( $post_id, 'post_grid_taxonomy_category', true );
30
 
31
  $post_grid_meta_author_display = get_post_meta( $post_id, 'post_grid_meta_author_display', true );
32
  $post_grid_meta_date_display = get_post_meta( $post_id, 'post_grid_meta_date_display', true );
34
  $post_grid_meta_tags_display = get_post_meta( $post_id, 'post_grid_meta_tags_display', true );
35
  $post_grid_meta_comments_display = get_post_meta( $post_id, 'post_grid_meta_comments_display', true );
36
 
37
+ $post_grid_items = get_post_meta( $post_id, 'post_grid_items', true );
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
+ {
45
+ $post_grid_items = array('post_title'=>'Title',
46
+ 'content'=>'Content',
47
+ 'thumbnail'=>'Thumbnail',
48
+ 'meta'=>'Meta',
49
+ 'social'=>'Social',
50
+ 'hover_items'=>'Hover Items',
51
+ 'woocommerce'=>'WooCommerce'
52
+ );
53
+ }
54
+
55
+ if(empty($post_grid_items_display))
56
+ {
57
+ $post_grid_items_display = array('post_title'=>'on',
58
+ 'content'=>'on',
59
+ 'thumbnail'=>'on',
60
+ 'meta'=>'on',
61
+ 'social'=>'on',
62
+ 'hover_items'=>'on',
63
+ 'woocommerce'=>'on'
64
+ );
65
+ }
66
+
67
+
68
+
69
 
70
  if(empty($post_grid_read_more_text))
71
  {
84
  $html .= '<div class="post-grid-container post-grid-container-'.$post_id.' '.$post_grid_themes.' " >';
85
  $html .= '<div class="post-grid-items" >';
86
 
87
+ if(!empty($post_grid_taxonomy))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  {
89
+ $wp_query = new WP_Query(
90
+ array (
91
+ 'post_type' => $post_grid_posttype,
92
+ 'post_status' => 'publish',
93
+ 'tax_query' => array(
94
+ array(
95
+ 'taxonomy' => $post_grid_taxonomy,
96
+ 'field' => 'id',
97
+ 'terms' => $post_grid_taxonomy_category,
98
+ )
99
+ ),
100
+
101
+ 'orderby' => $post_grid_query_orderby,
102
+ 'order' => $post_grid_query_order,
103
+ 'posts_per_page' => $post_grid_post_per_page,
104
+ 'paged' => get_query_var( 'paged' )
105
+ ) );
106
  }
107
+ else
 
 
 
 
 
 
 
108
  {
109
+ $wp_query = new WP_Query(
110
+ array (
111
+ 'post_type' => $post_grid_posttype,
112
+ 'post_status' => 'publish',
113
+ 'orderby' => $post_grid_query_orderby,
114
+ 'order' => $post_grid_query_order,
115
+ 'posts_per_page' => $post_grid_post_per_page,
116
+ 'paged' => get_query_var( 'paged' )
117
+ ) );
 
 
118
  }
119
 
120
+ if ( $wp_query->have_posts() ) :
121
 
122
+ while ( $wp_query->have_posts() ) : $wp_query->the_post();
 
 
 
123
 
124
 
125
 
126
+ $html .= '<div class="grid-single" style="max-width:'.$post_grid_items_width.';" >';
127
+ foreach($post_grid_items as $key=>$items)
128
+ {
129
+ if($key == 'post_title')
130
+ {
131
+ if(!empty($post_grid_items_display[$key]))
132
+ {
133
+ if(!empty($post_grid_wrapper[$key]['start']))
134
+ {
135
+ $html .=$post_grid_wrapper[$key]['start'];
136
+ }
137
+ else
138
+ {
139
+ $html .= '<div class="title">';
140
+ }
141
+
142
+ $html .= get_the_title();
143
+
144
+ if(!empty($post_grid_wrapper[$key]['end']))
145
+ {
146
+ $html .=$post_grid_wrapper[$key]['end'];
147
+ }
148
+ else
149
+ {
150
+ $html .= '</div >';
151
+ }
152
 
153
+ }
154
+
155
+ }
156
+ elseif($key == 'content')
157
+ {
158
+ if(!empty($post_grid_items_display[$key]))
159
+ {
160
+ $content = get_the_content();
161
+ $content = wp_trim_words( $content , $post_grid_excerpt_count, ' <a class="read-more" href="'.get_the_permalink().'">'.$post_grid_read_more_text.'</a>' );
162
+
163
+ if(!empty($post_grid_wrapper[$key]['start']))
164
+ {
165
+
166
+ $html .=$post_grid_wrapper[$key]['start'];
167
+ }
168
+ else
169
+ {
170
+ $html .= '<div class="content">';
171
+ }
172
+
173
+ $html .= $content;
174
+
175
+ if(!empty($post_grid_wrapper[$key]['end']))
176
+ {
177
+
178
+ $html .=$post_grid_wrapper[$key]['end'];
179
+ }
180
+ else
181
+ {
182
+ $html .= '</div >';
183
+ }
184
+
185
+
186
+
187
+ }
188
 
189
+ }
190
+ elseif($key == 'thumbnail')
191
+ {
192
+
193
+ if(!empty($post_grid_items_display[$key]))
194
+ {
195
+ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), $post_grid_thumb_size );
196
+ $thumb_url = $thumb['0'];
197
+
198
+ if(empty($thumb_url))
199
+ {
200
+ $thumb_url = $post_grid_empty_thumb;
201
+ }
202
+
203
+ if(!empty($post_grid_wrapper[$key]['start']))
204
+ {
205
+ $html .=$post_grid_wrapper[$key]['start'];
206
+ }
207
+ else
208
+ {
209
+ $html .= '<div class="thumb" style="height:'.$post_grid_items_width.';" >';
210
+ }
211
+
212
+
213
+ $html .= '<img src="'.$thumb_url.'" />';
214
+
215
+ if(!empty($post_grid_wrapper[$key]['end']))
216
+ {
217
+ $html .=$post_grid_wrapper[$key]['end'];
218
+ }
219
+ else
220
+ {
221
+ $html .= '</div >';
222
+ }
223
+
224
+
225
+ }
226
+
227
+
228
+ }
229
+ elseif($key == 'meta')
230
+ {
231
+ if(!empty($post_grid_items_display[$key]))
232
+ {
233
+
234
+ if(!empty($post_grid_wrapper[$key]['start']))
235
+ {
236
+ $html .=$post_grid_wrapper[$key]['start'];
237
+ }
238
+ else
239
+ {
240
+ $html .= '<div class="meta">';
241
+ }
242
+
243
+
244
+
245
+ if($post_grid_meta_date_display == 'yes')
246
+ $html .= '<span class="date">'.get_the_date('M d Y').'</span>';
247
+
248
+ if($post_grid_meta_author_display == 'yes')
249
+ $html .= '<span class="author">'.get_the_author().'</span>';
250
+
251
+ if(!empty($category_output) && $post_grid_meta_categories_display == 'yes')
252
+ $html .= '<span class="cayegory">'.trim($category_output, $separator).'</span>';
253
+
254
+ if(!empty($tags_links) && $post_grid_meta_tags_display == 'yes')
255
+ $html .= '<span class="tags">'.$tags_links.'</span>';
256
+
257
+ $total_comments = wp_count_comments( get_the_ID() );
258
+ if($post_grid_meta_comments_display == 'yes')
259
+ $html .= '<span class="comments">'.$total_comments->approved.'</span>';
260
+
261
+
262
+ if(!empty($post_grid_wrapper[$key]['end']))
263
+ {
264
+ $html .=$post_grid_wrapper[$key]['end'];
265
+ }
266
+ else
267
+ {
268
+ $html .= '</div >';
269
+ }
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+ }
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
+ }
281
+ elseif($key == 'social')
282
+ {
283
+ if(!empty($post_grid_items_display[$key]))
284
+ {
285
+
286
+
287
+ if(!empty($post_grid_wrapper[$key]['start']))
288
+ {
289
+ $html .=$post_grid_wrapper[$key]['start'];
290
+ }
291
+ else
292
+ {
293
+ $html .= '<div class="social-icon">';
294
+ }
295
+
296
+
297
+ $html .= '
298
+ <span class="fb">
299
+ <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"> </a>
300
+ </span>
301
+ <span class="twitter">
302
+ <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"></a>
303
+ </span>
304
+ <span class="gplus">
305
+ <a target="_blank" href="https://plus.google.com/share?url='.get_permalink().'"></a>
306
+ </span>
307
+ ';
308
+
309
+
310
+ if(!empty($post_grid_wrapper[$key]['end']))
311
+ {
312
+ $html .=$post_grid_wrapper[$key]['end'];
313
+ }
314
+ else
315
+ {
316
+ $html .= '</div >';
317
+ }
318
+
319
+
320
+
321
+
322
+
323
+ }
324
+
325
+
326
+
327
+ }
328
+
329
 
330
+ if($key == 'hover_items')
331
+ {
332
+ if(!empty($post_grid_items_display[$key]))
333
+ {
334
+ if(!empty($post_grid_wrapper[$key]['start']))
335
+ {
336
+ $html .=$post_grid_wrapper[$key]['start'];
337
+ }
338
+ else
339
+ {
340
+ $html .= '<div class="hover-items">';
341
+ }
342
+
343
+ //$html .= '<a title="Zoom." class="zoom"></a>';
344
+ $html .= '<a title="Read More." href="'.get_the_permalink().'" class="post-link"></a>';
345
+
346
+ if(!empty($post_grid_wrapper[$key]['end']))
347
+ {
348
+ $html .=$post_grid_wrapper[$key]['end'];
349
+ }
350
+ else
351
+ {
352
+ $html .= '</div >';
353
+ }
354
+
355
+ }
356
+
357
+ }
358
+
359
+ if($key == 'woocommerce')
360
+ {
361
+
362
+ $is_product = get_post_type( get_the_ID() );
363
+ $active_plugins = get_option('active_plugins');
364
+
365
+ if(in_array( 'woocommerce/woocommerce.php', (array) $active_plugins ) && $is_product=='product')
366
+ {
367
+ if(!empty($post_grid_items_display[$key]))
368
+ {
369
+ if(!empty($post_grid_wrapper[$key]['start']))
370
+ {
371
+ $html .=$post_grid_wrapper[$key]['start'];
372
+ }
373
+ else
374
+ {
375
+ $html .= '<div class="pg-woocommerce">';
376
+ }
377
+
378
+ global $woocommerce, $product;
379
+
380
+ $price = $product->get_price_html();
381
+ $cart = do_shortcode('[add_to_cart id="'.get_the_ID().'"]');
382
+ $rating = $product->get_average_rating();
383
+ $rating = (($rating/5)*100);
384
+ $html .= '<div class="pg-price">'.$price.'</div>';
385
+ $html .= '<div class="pg-cart">'.$cart.'</div>';
386
+ $html .= '<div class="pg-rating woocommerce"><div class="woocommerce-product-rating"><div class="star-rating" title="Rated '.$rating.'"><span style="width:'.$rating.'%;"></span></div></div></div>';
387
+
388
+ if(!empty($post_grid_wrapper[$key]['end']))
389
+ {
390
+ $html .=$post_grid_wrapper[$key]['end'];
391
+ }
392
+ else
393
+ {
394
+ $html .= '</div >';
395
+ }
396
 
397
+ }
398
+ }
399
+
400
+
 
 
 
401
 
402
+
403
+ }
404
 
405
 
406
+
407
+ else
408
+ {
409
+
410
+ }
411
+
412
+ }
413
+ $html .= '</div >';
414
+
415
  endwhile;
416
 
417
  $html .= '</div >';
themes/rounded/style.css CHANGED
@@ -11,6 +11,7 @@
11
  margin: 40px 15px;
12
  max-width: 250px;
13
  padding: 0;
 
14
  text-align: center;
15
  vertical-align: top;
16
  }
@@ -27,10 +28,9 @@
27
  border: medium none;
28
  border-radius: 0;
29
  box-shadow: none;
30
- width: 100%;
31
  }
32
 
33
-
34
  .post-grid-container.rounded .title {
35
  font-size: 15px;
36
  font-weight: bold;
11
  margin: 40px 15px;
12
  max-width: 250px;
13
  padding: 0;
14
+ position: relative;
15
  text-align: center;
16
  vertical-align: top;
17
  }
28
  border: medium none;
29
  border-radius: 0;
30
  box-shadow: none;
31
+ height: 100%;
32
  }
33
 
 
34
  .post-grid-container.rounded .title {
35
  font-size: 15px;
36
  font-weight: bold;