Post Grid - Version 1.1

Version Description

  • 03/03/2015 add- option for display/hide social share buttons.
    • 03/03/2015 remove- Thumbnail width.
    • 03/03/2015 add- Masonry grid enable for any theme.
    • 03/03/2015 remove- Masonry grid theme.
Download this release

Release Info

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

Code changes from version 1.0 to 1.1

includes/post-grid-functions.php CHANGED
@@ -150,7 +150,7 @@ add_action('wp_ajax_nopriv_post_grid_get_taxonomy_category', 'post_grid_get_taxo
150
 
151
 
152
 
153
-
154
 
155
  function post_grid_fix_pagination($link) {
156
 
150
 
151
 
152
 
153
+ // solve error replace #038; by &
154
 
155
  function post_grid_fix_pagination($link) {
156
 
includes/post-grid-meta.php CHANGED
@@ -65,22 +65,28 @@ function meta_boxes_post_grid_input( $post ) {
65
 
66
  $post_grid_post_per_page = get_post_meta( $post->ID, 'post_grid_post_per_page', true );
67
  $post_grid_themes = get_post_meta( $post->ID, 'post_grid_themes', true );
 
 
68
  $post_grid_bg_img = get_post_meta( $post->ID, 'post_grid_bg_img', true );
69
  $post_grid_thumb_size = get_post_meta( $post->ID, 'post_grid_thumb_size', true );
70
  $post_grid_empty_thumb = get_post_meta( $post->ID, 'post_grid_empty_thumb', true );
71
 
72
- $post_grid_social_share_position = get_post_meta( $post->ID, 'post_grid_social_share_position', true );
 
73
  $post_grid_pagination_display = get_post_meta( $post->ID, 'post_grid_pagination_display', true );
74
 
75
 
76
  $post_grid_read_more_position = get_post_meta( $post->ID, 'post_grid_read_more_position', true );
77
  $post_grid_read_more_hov_in_style = get_post_meta( $post->ID, 'post_grid_read_more_hov_in_style', true );
 
78
  $post_grid_read_more_text = get_post_meta( $post->ID, 'post_grid_read_more_text', true );
79
 
 
 
80
  $post_grid_posttype = get_post_meta( $post->ID, 'post_grid_posttype', true );
81
 
82
- $post_grid_width = get_post_meta( $post->ID, 'post_grid_width', true );
83
- $post_grid_thumb_width = get_post_meta( $post->ID, 'post_grid_thumb_width', true );
84
  $post_grid_thumb_height = get_post_meta( $post->ID, 'post_grid_thumb_height', true );
85
 
86
  $post_grid_meta_author_display = get_post_meta( $post->ID, 'post_grid_meta_author_display', true );
@@ -119,21 +125,17 @@ function meta_boxes_post_grid_input( $post ) {
119
  </div>
120
 
121
  <div class="option-box">
122
- <p class="option-title">Grid width</p>
123
- <p class="option-info"></p>
124
- <input type="text" size="10" name="post_grid_width" value="<?php if(!empty($post_grid_width))echo $post_grid_width; ?>" />
125
  </div>
126
 
127
- <div class="option-box">
128
- <p class="option-title">Grid thumbnail width</p>
129
- <p class="option-info"></p>
130
- <input type="text" size="10" name="post_grid_thumb_width" value="<?php if(!empty($post_grid_thumb_width))echo $post_grid_thumb_width; ?>" />
131
- </div>
132
 
133
  <div class="option-box">
134
  <p class="option-title">Grid thumbnail height</p>
135
- <p class="option-info"></p>
136
- <input type="text" size="10" name="post_grid_thumb_height" value="<?php if(!empty($post_grid_thumb_height)) echo $post_grid_thumb_height; ?>" />
137
  </div>
138
 
139
 
@@ -161,11 +163,29 @@ function meta_boxes_post_grid_input( $post ) {
161
  <p class="option-info"></p>
162
  <select name="post_grid_themes" >
163
  <option value="flat" <?php if($post_grid_themes=="flat")echo "selected"; ?>>Flat</option>
164
- <option value="rounded" <?php if($post_grid_themes=="rounded")echo "selected"; ?>>Rounded</option>
165
- <option value="masonry" <?php if($post_grid_themes=="masonry")echo "selected"; ?>>Masonry</option>
166
  </select>
167
  </div>
168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  <div class="option-box">
170
  <p class="option-title"><?php _e('Background Image.','post_grid'); ?></p>
171
  <p class="option-info"><?php _e('Background image for post grid area.','post_grid'); ?></p>
@@ -269,7 +289,7 @@ function meta_boxes_post_grid_input( $post ) {
269
  if(empty($post_grid_empty_thumb))
270
  {
271
  ?>
272
- <img class="post_grid_empty_thumb_display" width="300px" src="<?php echo wcps_plugin_url.'css/no-thumb.png'; ?>" />
273
  <?php
274
  }
275
  else
@@ -325,6 +345,19 @@ function meta_boxes_post_grid_input( $post ) {
325
  </script>
326
  </div>
327
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
 
329
  <div class="option-box">
330
  <p class="option-title">Social Share buttons position</p>
@@ -367,11 +400,13 @@ function meta_boxes_post_grid_input( $post ) {
367
  <option value="rotate" <?php if($post_grid_read_more_hov_in_style=="rotate")echo "selected"; ?>>Rotate</option>
368
 
369
  </select>
370
-
 
 
371
 
372
  <p class="option-title">Read more Text</p>
373
  <p class="option-info"></p>
374
- <input type="text" 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 />
375
 
376
 
377
 
@@ -434,9 +469,41 @@ function meta_boxes_post_grid_input( $post ) {
434
  </li>
435
  <li style="display: none;" class="box3 tab-box ">
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
 
438
  <div class="option-box">
439
- <p class="option-title">Grid Content Posttype</p>
440
  <p class="option-info"></p>
441
  <?php
442
 
@@ -451,6 +518,9 @@ function meta_boxes_post_grid_input( $post ) {
451
  <?php echo' >'. $post_type.'</label><br />' ;
452
 
453
  }
 
 
 
454
 
455
  else
456
  {
@@ -523,22 +593,28 @@ function meta_boxes_post_grid_save( $post_id ) {
523
  // Sanitize user input.
524
  $post_grid_post_per_page = sanitize_text_field( $_POST['post_grid_post_per_page'] );
525
  $post_grid_themes = sanitize_text_field( $_POST['post_grid_themes'] );
 
 
526
  $post_grid_bg_img = sanitize_text_field( $_POST['post_grid_bg_img'] );
527
 
528
  $post_grid_thumb_size = sanitize_text_field( $_POST['post_grid_thumb_size'] );
529
  $post_grid_empty_thumb = sanitize_text_field( $_POST['post_grid_empty_thumb'] );
530
 
531
- $post_grid_social_share_position = sanitize_text_field( $_POST['post_grid_social_share_position'] );
 
532
  $post_grid_pagination_display = sanitize_text_field( $_POST['post_grid_pagination_display'] );
533
 
534
- $post_grid_read_more_position = stripslashes_deep( $_POST['post_grid_read_more_position'] );
535
- $post_grid_read_more_hov_in_style = stripslashes_deep( $_POST['post_grid_read_more_hov_in_style'] );
536
- $post_grid_read_more_text = stripslashes_deep( $_POST['post_grid_read_more_text'] );
 
537
 
 
 
538
  $post_grid_posttype = stripslashes_deep( $_POST['post_grid_posttype'] );
539
 
540
- $post_grid_width = sanitize_text_field( $_POST['post_grid_width'] );
541
- $post_grid_thumb_width = sanitize_text_field( $_POST['post_grid_thumb_width'] );
542
  $post_grid_thumb_height = sanitize_text_field( $_POST['post_grid_thumb_height'] );
543
 
544
  $post_grid_meta_author_display = sanitize_text_field( $_POST['post_grid_meta_author_display'] );
@@ -553,21 +629,27 @@ function meta_boxes_post_grid_save( $post_id ) {
553
  // Update the meta field in the database.
554
  update_post_meta( $post_id, 'post_grid_post_per_page', $post_grid_post_per_page );
555
  update_post_meta( $post_id, 'post_grid_themes', $post_grid_themes );
 
 
556
  update_post_meta( $post_id, 'post_grid_bg_img', $post_grid_bg_img );
557
 
558
  update_post_meta( $post_id, 'post_grid_thumb_size', $post_grid_thumb_size );
559
  update_post_meta( $post_id, 'post_grid_empty_thumb', $post_grid_empty_thumb );
560
- update_post_meta( $post_id, 'post_grid_social_share_position', $post_grid_social_share_position );
 
561
  update_post_meta( $post_id, 'post_grid_pagination_display', $post_grid_pagination_display );
562
 
563
  update_post_meta( $post_id, 'post_grid_read_more_position', $post_grid_read_more_position );
564
  update_post_meta( $post_id, 'post_grid_read_more_hov_in_style', $post_grid_read_more_hov_in_style );
 
565
  update_post_meta( $post_id, 'post_grid_read_more_text', $post_grid_read_more_text );
566
 
 
 
567
  update_post_meta( $post_id, 'post_grid_posttype', $post_grid_posttype );
568
 
569
- update_post_meta( $post_id, 'post_grid_width', $post_grid_width );
570
- update_post_meta( $post_id, 'post_grid_thumb_width', $post_grid_thumb_width );
571
  update_post_meta( $post_id, 'post_grid_thumb_height', $post_grid_thumb_height );
572
 
573
  update_post_meta( $post_id, 'post_grid_meta_author_display', $post_grid_meta_author_display );
65
 
66
  $post_grid_post_per_page = get_post_meta( $post->ID, 'post_grid_post_per_page', true );
67
  $post_grid_themes = get_post_meta( $post->ID, 'post_grid_themes', true );
68
+ $post_grid_masonry_enable = get_post_meta( $post->ID, 'post_grid_masonry_enable', true );
69
+
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
 
84
+ $post_grid_query_order = get_post_meta( $post->ID, 'post_grid_query_order', true );
85
+ $post_grid_query_orderby = get_post_meta( $post->ID, 'post_grid_query_orderby', true );
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 );
125
  </div>
126
 
127
  <div class="option-box">
128
+ <p class="option-title">Grid items width</p>
129
+ <p class="option-info">Value with px, or %</p>
130
+ <input type="text" placeholder="ex: 250px" size="10" name="post_grid_items_width" value="<?php if(!empty($post_grid_items_width))echo $post_grid_items_width; ?>" />
131
  </div>
132
 
133
+
 
 
 
 
134
 
135
  <div class="option-box">
136
  <p class="option-title">Grid thumbnail height</p>
137
+ <p class="option-info">Value with px</p>
138
+ <input type="text" placeholder="ex: 150px" size="10" name="post_grid_thumb_height" value="<?php if(!empty($post_grid_thumb_height)) echo $post_grid_thumb_height; ?>" />
139
  </div>
140
 
141
 
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
 
170
+
171
+ <div class="option-box">
172
+ <p class="option-title">Active Masonry Grid</p>
173
+ <p class="option-info">Masonry Style grid.</p>
174
+ <select name="post_grid_masonry_enable" >
175
+ <option value="no" <?php if($post_grid_masonry_enable=="no")echo "selected"; ?>>No</option>
176
+ <option value="yes" <?php if($post_grid_masonry_enable=="yes")echo "selected"; ?>>Yes</option>
177
+
178
+ </select>
179
+ </div>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
  <div class="option-box">
190
  <p class="option-title"><?php _e('Background Image.','post_grid'); ?></p>
191
  <p class="option-info"><?php _e('Background image for post grid area.','post_grid'); ?></p>
289
  if(empty($post_grid_empty_thumb))
290
  {
291
  ?>
292
+ <img class="post_grid_empty_thumb_display" width="300px" src="<?php echo post_grid_plugin_url.'css/no-thumb.png'; ?>" />
293
  <?php
294
  }
295
  else
345
  </script>
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>
353
+ <option value="no" <?php if($post_grid_social_share_display=="no")echo "selected"; ?>>No</option>
354
+
355
+
356
+
357
+ </select>
358
+ </div>
359
+
360
+
361
 
362
  <div class="option-box">
363
  <p class="option-title">Social Share buttons position</p>
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
 
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>
475
+ <select name="post_grid_query_order" >
476
+ <option value="ASC" <?php if($post_grid_query_order=="ASC") echo "selected"; ?>>ASC</option>
477
+ <option value="DESC" <?php if($post_grid_query_order=="DESC") echo "selected"; ?>>DESC</option>
478
+
479
+ </select>
480
+ </div>
481
+
482
+ <div class="option-box">
483
+ <p class="option-title"><?php _e('Post query orderby','post_grid'); ?></p>
484
+ <p class="option-info"></p>
485
+ <select name="post_grid_query_orderby" >
486
+ <option value="none" <?php if($post_grid_query_orderby=="none") echo "selected"; ?>>None</option>
487
+ <option value="ID" <?php if($post_grid_query_orderby=="ID") echo "selected"; ?>>ID</option>
488
+ <option value="date" <?php if($post_grid_query_orderby=="date") echo "selected"; ?>>Date</option>
489
+ <option value="rand" <?php if($post_grid_query_orderby=="rand") echo "selected"; ?>>Rand</option> <option value="comment_count" <?php if($post_grid_query_orderby=="comment_count") echo "selected"; ?>>Comment Count</option>
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>
501
+
502
+
503
+
504
 
505
  <div class="option-box">
506
+ <p class="option-title">Grid Content Post type</p>
507
  <p class="option-info"></p>
508
  <?php
509
 
518
  <?php echo' >'. $post_type.'</label><br />' ;
519
 
520
  }
521
+
522
+
523
+
524
 
525
  else
526
  {
593
  // Sanitize user input.
594
  $post_grid_post_per_page = sanitize_text_field( $_POST['post_grid_post_per_page'] );
595
  $post_grid_themes = sanitize_text_field( $_POST['post_grid_themes'] );
596
+ $post_grid_masonry_enable = sanitize_text_field( $_POST['post_grid_masonry_enable'] );
597
+
598
  $post_grid_bg_img = sanitize_text_field( $_POST['post_grid_bg_img'] );
599
 
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'] );
629
  // Update the meta field in the database.
630
  update_post_meta( $post_id, 'post_grid_post_per_page', $post_grid_post_per_page );
631
  update_post_meta( $post_id, 'post_grid_themes', $post_grid_themes );
632
+ update_post_meta( $post_id, 'post_grid_masonry_enable', $post_grid_masonry_enable );
633
+
634
  update_post_meta( $post_id, 'post_grid_bg_img', $post_grid_bg_img );
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
 
647
+ update_post_meta( $post_id, 'post_grid_query_order', $post_grid_query_order );
648
+ update_post_meta( $post_id, 'post_grid_query_orderby', $post_grid_query_orderby );
649
  update_post_meta( $post_id, 'post_grid_posttype', $post_grid_posttype );
650
 
651
+ update_post_meta( $post_id, 'post_grid_items_width', $post_grid_items_width );
652
+ //update_post_meta( $post_id, 'post_grid_thumb_width', $post_grid_thumb_width );
653
  update_post_meta( $post_id, 'post_grid_thumb_height', $post_grid_thumb_height );
654
 
655
  update_post_meta( $post_id, 'post_grid_meta_author_display', $post_grid_meta_author_display );
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.0
7
  Author: paratheme
8
  Author URI: http://paratheme.com
9
  License: GPLv2 or later
@@ -30,7 +30,7 @@ require_once( plugin_dir_path( __FILE__ ) . 'includes/post-grid-functions.php');
30
 
31
  require_once( plugin_dir_path( __FILE__ ) . 'themes/flat/index.php');
32
  require_once( plugin_dir_path( __FILE__ ) . 'themes/rounded/index.php');
33
- require_once( plugin_dir_path( __FILE__ ) . 'themes/masonry/index.php');
34
 
35
  function post_grid_init_scripts()
36
  {
@@ -46,7 +46,6 @@ function post_grid_init_scripts()
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
- wp_enqueue_style('post-grid-style-masonry', post_grid_plugin_url.'themes/masonry/style.css');
50
 
51
 
52
  }
@@ -64,7 +63,7 @@ register_activation_hook(__FILE__, 'post_grid_activation');
64
 
65
  function post_grid_activation()
66
  {
67
- $post_grid_version= "1.0";
68
  update_option('post_grid_version', $post_grid_version); //update plugin version.
69
 
70
  $post_grid_customer_type= "free"; //customer_type "free"
@@ -85,7 +84,7 @@ function post_grid_display($atts, $content = null ) {
85
 
86
  $post_grid_themes = get_post_meta( $post_id, 'post_grid_themes', true );
87
 
88
- $html ="";
89
 
90
  if($post_grid_themes== "flat")
91
  {
@@ -95,10 +94,6 @@ function post_grid_display($atts, $content = null ) {
95
  elseif($post_grid_themes== "rounded")
96
  {
97
  $html.= post_grid_themes_rounded($post_id);
98
- }
99
- elseif($post_grid_themes== "masonry")
100
- {
101
- $html.= post_grid_themes_masonry($post_id);
102
  }
103
  else
104
  {
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
30
 
31
  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
  {
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
  }
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"
84
 
85
  $post_grid_themes = get_post_meta( $post_id, 'post_grid_themes', true );
86
 
87
+ $html = '';
88
 
89
  if($post_grid_themes== "flat")
90
  {
94
  elseif($post_grid_themes== "rounded")
95
  {
96
  $html.= post_grid_themes_rounded($post_id);
 
 
 
 
97
  }
98
  else
99
  {
readme.txt CHANGED
@@ -4,7 +4,7 @@
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.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -19,7 +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
- * [See the Live demo!&raquo;](http://paratheme.com/demo/post-grid/post-grid/)
 
23
 
24
 
25
 
@@ -39,6 +40,11 @@ Use any where by short-codes and easy customize via short-code generator page, y
39
  * Custom grid width.
40
  * Custom grid thumbnail height.
41
 
 
 
 
 
 
42
 
43
  == Installation ==
44
 
@@ -69,5 +75,12 @@ then paste this shortcode anywhere in your page to display grid<br />
69
  == Changelog ==
70
 
71
 
 
 
 
 
 
 
 
72
  = 1.0 =
73
  * 06/02/2015 Initial release.
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
 
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
 
40
  * Custom grid width.
41
  * Custom grid thumbnail height.
42
 
43
+ <strong>Premium Features</strong><br />
44
+
45
+ * Query post from taxonomy & terms.
46
+ * Total 4 different layout.
47
+
48
 
49
  == Installation ==
50
 
75
  == Changelog ==
76
 
77
 
78
+
79
+ = 1.1 =
80
+ * 03/03/2015 add- option for display/hide social share buttons.
81
+ * 03/03/2015 remove- Thumbnail width.
82
+ * 03/03/2015 add- Masonry grid enable for any theme.
83
+ * 03/03/2015 remove- Masonry grid theme.
84
+
85
  = 1.0 =
86
  * 06/02/2015 Initial release.
themes/flat/index.php CHANGED
@@ -5,23 +5,29 @@ function post_grid_themes_flat($post_id)
5
  {
6
 
7
  $post_grid_themes = get_post_meta( $post_id, 'post_grid_themes', true );
 
 
8
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
9
  $post_grid_thumb_size = get_post_meta( $post_id, 'post_grid_thumb_size', true );
10
  $post_grid_empty_thumb = get_post_meta( $post_id, 'post_grid_empty_thumb', true );
11
 
12
  $post_grid_post_per_page = get_post_meta( $post_id, 'post_grid_post_per_page', true );
13
  $post_grid_social_share_position = get_post_meta( $post_id, 'post_grid_social_share_position', true );
 
14
  $post_grid_pagination_display = get_post_meta( $post_id, 'post_grid_pagination_display', true );
15
 
16
  $post_grid_read_more_position = get_post_meta( $post_id, 'post_grid_read_more_position', true );
17
  $post_grid_read_more_hov_in_style = get_post_meta( $post_id, 'post_grid_read_more_hov_in_style', true );
 
18
  $post_grid_read_more_text = get_post_meta( $post_id, 'post_grid_read_more_text', true );
19
 
20
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
21
- $post_grid_width = get_post_meta( $post_id, 'post_grid_width', true );
22
  //$post_grid_thumb_width = get_post_meta( $post_id, 'post_grid_thumb_width', true );
23
  $post_grid_thumb_height = get_post_meta( $post_id, 'post_grid_thumb_height', true );
24
 
 
 
25
  $post_grid_posttype = get_post_meta( $post_id, 'post_grid_posttype', true );
26
 
27
  $post_grid_meta_author_display = get_post_meta( $post_id, 'post_grid_meta_author_display', true );
@@ -30,22 +36,31 @@ function post_grid_themes_flat($post_id)
30
  $post_grid_meta_tags_display = get_post_meta( $post_id, 'post_grid_meta_tags_display', true );
31
  $post_grid_meta_comments_display = get_post_meta( $post_id, 'post_grid_meta_comments_display', true );
32
 
33
-
34
-
 
 
 
 
 
 
 
 
35
 
36
 
37
  $html = '';
38
  $html .= '<div style="background:url('.$post_grid_bg_img.');" class="post-grid-container-main" >';
39
  $html .= '<div class="post-grid-container post-grid-container-'.$post_id.' '.$post_grid_themes.' " >';
40
-
41
 
42
  $wp_query = new WP_Query(
43
  array (
44
  'post_type' => $post_grid_posttype,
45
  'post_status' => 'publish',
 
 
46
  'posts_per_page' => $post_grid_post_per_page,
47
  'paged' => get_query_var( 'paged' )
48
-
49
  ) );
50
 
51
  if ( $wp_query->have_posts() ) :
@@ -61,26 +76,30 @@ function post_grid_themes_flat($post_id)
61
  }
62
 
63
 
64
- $html .= '<div class="grid-single" style="max-width:'.$post_grid_width.';" >';
65
  $html .= '<div class="thumb" style="max-height:'.$post_grid_thumb_height.';" ><img src="'.$thumb_url.'" />';
66
 
67
  $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 >';
68
- $html .= '<div class="social-icon '.$post_grid_social_share_position.'" >
69
- <span class="fb">
70
- <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"> </a>
71
- </span>
72
- <span class="twitter">
73
- <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"></a>
74
- </span>
75
- <span class="gplus">
76
- <a target="_blank" href="https://plus.google.com/share?url='.get_permalink().'"></a>
77
- </span>
78
 
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
 
82
 
83
- </div >';
84
  $html .= '</div>';
85
 
86
 
@@ -134,10 +153,8 @@ function post_grid_themes_flat($post_id)
134
 
135
  $html .= '<div class="title" >'.get_the_title().'</div >';
136
 
137
- $content_main =apply_filters('the_content', get_the_content());
138
- $content = wp_trim_words( $content_main , 30, ' <a class="read-more" href="'.get_the_permalink().'">[...]</a>' );
139
-
140
-
141
 
142
 
143
  $html .= '<div class="content" >'.$content.'</div >';
@@ -151,7 +168,7 @@ function post_grid_themes_flat($post_id)
151
  endwhile;
152
 
153
 
154
-
155
 
156
 
157
 
@@ -182,5 +199,36 @@ function post_grid_themes_flat($post_id)
182
  $html .= '</div>';
183
  $html .= '</div>';
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  return $html;
186
  }
5
  {
6
 
7
  $post_grid_themes = get_post_meta( $post_id, 'post_grid_themes', true );
8
+ $post_grid_masonry_enable = get_post_meta( $post_id, 'post_grid_masonry_enable', true );
9
+
10
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
11
  $post_grid_thumb_size = get_post_meta( $post_id, 'post_grid_thumb_size', true );
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 );
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.';
42
+ }
43
+
44
+ if(empty($post_grid_excerpt_count))
45
+ {
46
+ $post_grid_excerpt_count = 30;
47
+ }
48
+
49
 
50
 
51
  $html = '';
52
  $html .= '<div style="background:url('.$post_grid_bg_img.');" class="post-grid-container-main" >';
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() ) :
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
 
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 >';
168
  endwhile;
169
 
170
 
171
+ $html .= '</div >';
172
 
173
 
174
 
199
  $html .= '</div>';
200
  $html .= '</div>';
201
 
202
+
203
+
204
+
205
+ if($post_grid_masonry_enable == 'yes' )
206
+ {
207
+ $html .= '<script>
208
+ jQuery(document).ready(function($) {
209
+ var container = document.querySelector(".post-grid-container-'.$post_id.' .post-grid-items");
210
+ var msnry = new Masonry( container, {isFitWidth: true
211
+
212
+ });
213
+ });
214
+ </script>';
215
+
216
+
217
+
218
+ $html .= '<style type="text/css">
219
+
220
+ .post-grid-container-'.$post_id.' .post-grid-items {
221
+ margin: 0 auto !important;
222
+ }
223
+ </style>
224
+ ';
225
+
226
+ }
227
+
228
+
229
+
230
+
231
+
232
+
233
  return $html;
234
  }
themes/masonry/index.php DELETED
@@ -1,218 +0,0 @@
1
- <?php
2
-
3
-
4
- function post_grid_themes_masonry($post_id)
5
- {
6
-
7
- $post_grid_themes = get_post_meta( $post_id, 'post_grid_themes', true );
8
- $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
9
- $post_grid_thumb_size = get_post_meta( $post_id, 'post_grid_thumb_size', true );
10
- $post_grid_empty_thumb = get_post_meta( $post_id, 'post_grid_empty_thumb', true );
11
-
12
- $post_grid_post_per_page = get_post_meta( $post_id, 'post_grid_post_per_page', true );
13
- $post_grid_social_share_position = get_post_meta( $post_id, 'post_grid_social_share_position', true );
14
- $post_grid_pagination_display = get_post_meta( $post_id, 'post_grid_pagination_display', true );
15
-
16
- $post_grid_read_more_position = get_post_meta( $post_id, 'post_grid_read_more_position', true );
17
- $post_grid_read_more_hov_in_style = get_post_meta( $post_id, 'post_grid_read_more_hov_in_style', true );
18
- $post_grid_read_more_text = get_post_meta( $post_id, 'post_grid_read_more_text', true );
19
-
20
- $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
21
- $post_grid_width = get_post_meta( $post_id, 'post_grid_width', true );
22
- //$post_grid_thumb_width = get_post_meta( $post_id, 'post_grid_thumb_width', true );
23
- $post_grid_thumb_height = get_post_meta( $post_id, 'post_grid_thumb_height', true );
24
-
25
- $post_grid_posttype = get_post_meta( $post_id, 'post_grid_posttype', true );
26
-
27
- $post_grid_meta_author_display = get_post_meta( $post_id, 'post_grid_meta_author_display', true );
28
- $post_grid_meta_date_display = get_post_meta( $post_id, 'post_grid_meta_date_display', true );
29
- $post_grid_meta_categories_display = get_post_meta( $post_id, 'post_grid_meta_categories_display', true );
30
- $post_grid_meta_tags_display = get_post_meta( $post_id, 'post_grid_meta_tags_display', true );
31
- $post_grid_meta_comments_display = get_post_meta( $post_id, 'post_grid_meta_comments_display', true );
32
-
33
-
34
-
35
-
36
-
37
- $html = '';
38
- $html .= '<div style="background:url('.$post_grid_bg_img.');" class="post-grid-container-main" >';
39
- $html .= '<div class="post-grid-container post-grid-container-'.$post_id.' '.$post_grid_themes.' " >';
40
-
41
-
42
- $wp_query = new WP_Query(
43
- array (
44
- 'post_type' => $post_grid_posttype,
45
- 'post_status' => 'publish',
46
- 'posts_per_page' => $post_grid_post_per_page,
47
- 'paged' => get_query_var( 'paged' )
48
-
49
- ) );
50
-
51
- if ( $wp_query->have_posts() ) :
52
-
53
- while ( $wp_query->have_posts() ) : $wp_query->the_post();
54
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), $post_grid_thumb_size );
55
- $thumb_url = $thumb['0'];
56
-
57
-
58
- if(empty($thumb_url))
59
- {
60
- $thumb_url = $post_grid_empty_thumb;
61
- }
62
-
63
-
64
- $html .= '<div class="grid-single" style="max-width:'.$post_grid_width.';" >';
65
- $html .= '<div class="thumb" style="max-height:'.$post_grid_thumb_height.';" ><img src="'.$thumb_url.'" />';
66
-
67
- $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 >';
68
- $html .= '<div class="social-icon '.$post_grid_social_share_position.'" >
69
- <span class="fb">
70
- <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"> </a>
71
- </span>
72
- <span class="twitter">
73
- <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"></a>
74
- </span>
75
- <span class="gplus">
76
- <a target="_blank" href="https://plus.google.com/share?url='.get_permalink().'"></a>
77
- </span>
78
-
79
-
80
-
81
-
82
-
83
- </div >';
84
-
85
-
86
- $html .= '<div class="title" >'.get_the_title().'</div >';
87
-
88
-
89
- $html .= '</div>';
90
-
91
-
92
- /*
93
-
94
- $categories = get_the_category();
95
- $separator = ', ';
96
- $category_output = '';
97
- if($categories){
98
- foreach($categories as $category) {
99
- $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;
100
- }
101
-
102
- }
103
-
104
- $tags = get_the_tags(get_the_ID());
105
- if(empty($tags))
106
- {
107
- $tags = array();
108
- }
109
- $tags_links = '';
110
-
111
- foreach ($tags as $tag)
112
- {
113
- $tags_links .= '<a href="'.get_tag_link($tag->term_id).'" >#'.$tag->name.'</a> ';
114
-
115
- }
116
- */
117
-
118
- //$total_comments = wp_count_comments( get_the_ID() );
119
-
120
- //$html .= '<div class="meta" >';
121
-
122
- //if($post_grid_meta_date_display == 'yes')
123
- //$html .= '<span class="date">'.get_the_date('M d Y').'</span>';
124
-
125
- //if($post_grid_meta_author_display == 'yes')
126
- //$html .= '<span class="author">'.get_the_author().'</span>';
127
-
128
- //if(!empty($category_output) && $post_grid_meta_categories_display == 'yes')
129
- //$html .= '<span class="cayegory">'.trim($category_output, $separator).'</span>';
130
-
131
- //if(!empty($tags_links) && $post_grid_meta_tags_display == 'yes')
132
- //$html .= '<span class="tags">'.$tags_links.'</span>';
133
-
134
- //if($post_grid_meta_comments_display == 'yes')
135
- //$html .= '<span class="comments">'.$total_comments->approved.'</span>';
136
-
137
- //$html .= '</div >';
138
-
139
-
140
-
141
-
142
- $content_main =apply_filters('the_content', get_the_content());
143
- $content = wp_trim_words( $content_main , 30, ' <a class="read-more" href="'.get_the_permalink().'">[...]</a>' );
144
-
145
-
146
-
147
-
148
- //$html .= '<div class="content" >'.$content.'</div >';
149
-
150
-
151
-
152
-
153
-
154
-
155
- $html .= '</div >';
156
- endwhile;
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
- //$html .= '<div class="load-more"><span postid="'.$post_id.'" per_page="'.$post_grid_post_per_page.'" offset="'.$post_grid_post_per_page.'" class="load">Load More</span></div >';
168
-
169
-
170
-
171
-
172
- wp_reset_query();
173
- endif;
174
-
175
- $html .= '</div >';
176
-
177
-
178
-
179
- if($post_grid_pagination_display == 'yes')
180
- {
181
- $html .= '<div class="paginate">';
182
- $big = 999999999; // need an unlikely integer
183
- $html .= paginate_links( array(
184
- 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
185
- 'format' => '?paged=%#%',
186
- 'current' => max( 1, get_query_var('paged') ),
187
- 'total' => $wp_query->max_num_pages
188
- ) );
189
-
190
- $html .= '</div >';
191
- }
192
-
193
-
194
-
195
- $html .= '</div >';
196
- $html .= '<script>
197
- jQuery(document).ready(function($) {
198
- var container = document.querySelector(".post-grid-container");
199
- var msnry = new Masonry( container, {isFitWidth: true
200
-
201
- });
202
- });
203
- </script>';
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
- return $html;
218
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
themes/masonry/style.css DELETED
@@ -1,83 +0,0 @@
1
- @charset "utf-8";
2
- /* CSS Document */
3
-
4
-
5
-
6
-
7
- .post-grid-container.masonry {
8
- margin: 0 auto;
9
- text-align: center;
10
- }
11
-
12
- .post-grid-container.masonry .grid-single {
13
- display: inline-block;
14
- margin: 10px;
15
- padding: 0;
16
- text-align: center;
17
- vertical-align: top;
18
- }
19
-
20
- .post-grid-container.masonry .thumb {
21
- overflow: hidden;
22
- position: relative;
23
- }
24
- .post-grid-container.masonry .thumb img {
25
- border: medium none;
26
- border-radius: 0;
27
- box-shadow: none;
28
- width: 100%;
29
- }
30
-
31
- .post-grid-container.masonry .title {
32
- background: none repeat scroll 0 0 rgba(0, 0, 0, 0.3);
33
- bottom: 0;
34
- color: rgb(255, 255, 255);
35
- font-size: 15px;
36
- font-weight: bold;
37
- padding: 10px;
38
- position: absolute;
39
- text-align: left;
40
- width: 100%;
41
- }
42
-
43
- .post-grid-container.masonry .content {
44
- font-size: 13px;
45
- line-height: inherit;
46
- text-align: left;
47
- }
48
-
49
- .post-grid-container.masonry .content .read-more{
50
- text-decoration:none;
51
- }
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
themes/rounded/index.php CHANGED
@@ -5,20 +5,24 @@ function post_grid_themes_rounded($post_id)
5
  {
6
 
7
  $post_grid_themes = get_post_meta( $post_id, 'post_grid_themes', true );
 
 
8
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
9
  $post_grid_thumb_size = get_post_meta( $post_id, 'post_grid_thumb_size', true );
10
  $post_grid_empty_thumb = get_post_meta( $post_id, 'post_grid_empty_thumb', true );
11
 
12
  $post_grid_post_per_page = get_post_meta( $post_id, 'post_grid_post_per_page', true );
13
  $post_grid_social_share_position = get_post_meta( $post_id, 'post_grid_social_share_position', true );
 
14
  $post_grid_pagination_display = get_post_meta( $post_id, 'post_grid_pagination_display', true );
15
 
16
  $post_grid_read_more_position = get_post_meta( $post_id, 'post_grid_read_more_position', true );
17
  $post_grid_read_more_hov_in_style = get_post_meta( $post_id, 'post_grid_read_more_hov_in_style', true );
 
18
  $post_grid_read_more_text = get_post_meta( $post_id, 'post_grid_read_more_text', true );
19
 
20
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
21
- $post_grid_width = get_post_meta( $post_id, 'post_grid_width', true );
22
  //$post_grid_thumb_width = get_post_meta( $post_id, 'post_grid_thumb_width', true );
23
  $post_grid_thumb_height = get_post_meta( $post_id, 'post_grid_thumb_height', true );
24
 
@@ -31,13 +35,22 @@ function post_grid_themes_rounded($post_id)
31
  $post_grid_meta_comments_display = get_post_meta( $post_id, 'post_grid_meta_comments_display', true );
32
 
33
 
34
-
35
-
 
 
 
 
 
 
 
 
 
36
 
37
  $html = '';
38
  $html .= '<div style="background:url('.$post_grid_bg_img.');" class="post-grid-container-main" >';
39
  $html .= '<div class="post-grid-container post-grid-container-'.$post_id.' '.$post_grid_themes.' " >';
40
-
41
 
42
  $wp_query = new WP_Query(
43
  array (
@@ -59,26 +72,30 @@ function post_grid_themes_rounded($post_id)
59
  $thumb_url = $post_grid_empty_thumb;
60
  }
61
 
62
- $html .= '<div class="grid-single" style="max-width:'.$post_grid_width.';" >';
63
- $html .= '<div class="thumb" style=" width:'.$post_grid_thumb_width.';height:'.$post_grid_thumb_height.';" ><img src="'.$thumb_url.'" />';
64
 
65
  $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 >';
66
- $html .= '<div class="social-icon '.$post_grid_social_share_position.'" >
67
- <span class="fb">
68
- <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'"> </a>
69
- </span>
70
- <span class="twitter">
71
- <a target="_blank" href="https://twitter.com/intent/tweet?url='.get_permalink().'&text='.get_the_title().'"></a>
72
- </span>
73
- <span class="gplus">
74
- <a target="_blank" href="https://plus.google.com/share?url='.get_permalink().'"></a>
75
- </span>
76
 
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
 
80
 
81
- </div >';
82
  $html .= '</div>';
83
 
84
 
@@ -132,8 +149,10 @@ function post_grid_themes_rounded($post_id)
132
 
133
  $html .= '<div class="title" >'.get_the_title().'</div >';
134
 
135
- $content_main =apply_filters('the_content', get_the_content());
136
- $content = wp_trim_words( $content_main , 30, ' <a class="read-more" href="'.get_the_permalink().'">[...]</a>' );
 
 
137
 
138
 
139
 
@@ -148,7 +167,7 @@ function post_grid_themes_rounded($post_id)
148
  $html .= '</div >';
149
  endwhile;
150
 
151
-
152
 
153
 
154
 
@@ -181,5 +200,33 @@ function post_grid_themes_rounded($post_id)
181
  $html .= '</div >';
182
 
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  return $html;
185
  }
5
  {
6
 
7
  $post_grid_themes = get_post_meta( $post_id, 'post_grid_themes', true );
8
+ $post_grid_masonry_enable = get_post_meta( $post_id, 'post_grid_masonry_enable', true );
9
+
10
  $post_grid_bg_img = get_post_meta( $post_id, 'post_grid_bg_img', true );
11
  $post_grid_thumb_size = get_post_meta( $post_id, 'post_grid_thumb_size', true );
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
 
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
+ {
40
+ $post_grid_read_more_text = 'Read More.';
41
+ }
42
+
43
+ if(empty($post_grid_excerpt_count))
44
+ {
45
+ $post_grid_excerpt_count = 30;
46
+ }
47
+
48
+
49
 
50
  $html = '';
51
  $html .= '<div style="background:url('.$post_grid_bg_img.');" class="post-grid-container-main" >';
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 (
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
 
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
 
167
  $html .= '</div >';
168
  endwhile;
169
 
170
+ $html .= '</div >';
171
 
172
 
173
 
200
  $html .= '</div >';
201
 
202
 
203
+
204
+
205
+ if($post_grid_masonry_enable == 'yes' )
206
+ {
207
+ $html .= '<script>
208
+ jQuery(document).ready(function($) {
209
+ var container = document.querySelector(".post-grid-container-'.$post_id.' .post-grid-items");
210
+ var msnry = new Masonry( container, {isFitWidth: true
211
+
212
+ });
213
+ });
214
+ </script>';
215
+
216
+
217
+
218
+ $html .= '<style type="text/css">
219
+
220
+ .post-grid-container-'.$post_id.' .post-grid-items {
221
+ margin: 0 auto !important;
222
+ }
223
+ </style>
224
+ ';
225
+
226
+ }
227
+
228
+
229
+
230
+
231
  return $html;
232
  }
themes/rounded/style.css CHANGED
@@ -19,7 +19,6 @@
19
  border-radius: 50%;
20
  box-shadow: 0 0 3px 0 rgb(153, 153, 153);
21
  margin-bottom: 25px;
22
- max-height: 200px;
23
  overflow: hidden;
24
  position: relative;
25
  }
19
  border-radius: 50%;
20
  box-shadow: 0 0 3px 0 rgb(153, 153, 153);
21
  margin-bottom: 25px;
 
22
  overflow: hidden;
23
  position: relative;
24
  }