Changeset 1194206
- Timestamp:
- 07/07/2015 03:46:34 PM (11 years ago)
- Location:
- advanced-recent-posts/trunk
- Files:
-
- 5 edited
-
backend/lptw-recent-posts-backend.php (modified) (3 diffs)
-
backend/lptw-recent-posts-shortcode-builder.js (modified) (7 diffs)
-
lptw-recent-posts.css (modified) (3 diffs)
-
lptw-recent-posts.php (modified) (11 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
advanced-recent-posts/trunk/backend/lptw-recent-posts-backend.php
r1191281 r1194206 96 96 </tr> 97 97 <tr id="columns_and_width"> 98 <th scope="row">Columns and width:</th>98 <th scope="row">Columns and dimensions:</th> 99 99 <td> 100 100 <div class="lptw-sb-row"> … … 120 120 <div class="lptw-sb-row"> 121 121 <label for="sb_height"><input type="number" class="small-text layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" value="400" id="sb_height" min="1" step="1" name="sb_height" disabled="disabled"> 122 The fixed height of the cell in pixels, only for Responsive Grid. If not set - all cells have auto height.</label> 122 The fixed height of the Post in pixels, only for Responsive Grid. If value = 0, height of all Featured set to auto height.</label> 123 </div> 124 <div class="lptw-sb-row"> 125 <label for="sb_featured_height"><input type="number" class="small-text layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" value="400" id="sb_featured_height" min="1" step="1" name="sb_featured_height" disabled="disabled"> 126 The fixed height of the <b><u>Featured</u></b> Post in pixels, only for Responsive Grid. If value = 0, height of all <b><u>Featured</u></b> Posts set to 400 px.</label> 127 </div> 128 <div class="lptw-sb-row"> 129 <label for="sb_min_height"><input type="number" class="small-text layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" value="0" id="sb_min_height" min="0" step="1" name="sb_min_height" disabled="disabled"> 130 The minimal height of all Posts in pixels, only for Responsive Grid. If value = 0, minimal height is not limited.</label> 123 131 </div> 124 132 </td> … … 265 273 </tr> 266 274 <tr> 275 <th scope="row">Post Excerpt:</th> 276 <td> 277 <fieldset id="post_excerpt" class="layout-basic-hide layout-grid-show layout-thumbnail-hide layout-dropcap-hide" disabled="disabled"> 278 <p> 279 <label for="excerpt_show"><input type="checkbox" checked="checked" value="0" id="excerpt_show" name="excerpt_show" > 280 Show the Post Excerpt.</label> 281 </p> 282 <p> 283 <label for="excerpt_lenght"><input type="number" class="small-text" value="35" id="excerpt_lenght" min="1" step="1" name="excerpt_lenght"> 284 Post Excerpt lenght in words.</label> 285 </p> 286 <p> 287 <label for="ignore_more_tag"><input type="checkbox" value="0" id="ignore_more_tag" name="ignore_more_tag" > 288 Ignore <!-- more --> tag.</label> 289 </p> 290 </fieldset> 291 <p class="description">Only for Responsive Grid layout yet.</p> 292 </td> 293 </tr> 294 <tr> 267 295 <th scope="row">Show date and time:</th> 268 296 <td> -
advanced-recent-posts/trunk/backend/lptw-recent-posts-shortcode-builder.js
r1191281 r1194206 109 109 110 110 var sb_height = $("#sb_height").val(); 111 if ( sb_height < 1 ) { sb_height = ''; } 112 113 var sb_featured_height = $("#sb_featured_height").val(); 114 if ( sb_featured_height < 1 ) { sb_featured_height = ''; } 115 116 var sb_min_height = $("#sb_min_height").val(); 111 117 112 118 var sb_columns = $('#sb_columns').val(); … … 134 140 var sb_dropcap_background_color = $("#dropcap-background-color").val(); 135 141 var sb_dropcap_text_color = $("#dropcap-text-color").val(); 136 142 143 /* --- Excerpt Section start --- */ 144 if ($("#excerpt_show").is(":checked") == true) { 145 var sb_excerpt_show = "true"; 146 } else { 147 var sb_excerpt_show = "false"; 148 } 149 150 var sb_excerpt_lenght = $("#excerpt_lenght").val(); 151 152 if ($("#ignore_more_tag").is(":checked") == true) { 153 var sb_ignore_more_tag = "true"; 154 } else { 155 var sb_ignore_more_tag = "false"; 156 } 157 /* --- End --- */ 158 137 159 if ($("#show_date_before_title").is(":checked") == true) { 138 160 var sb_show_date_before_title = "true"; … … 167 189 if (sb_layout == 'basic') { 168 190 sb_height = ''; 191 sb_featured_height = ''; 192 sb_min_height = ''; 193 sb_excerpt_show = ''; 194 sb_excerpt_lenght = ''; 195 sb_ignore_more_tag = ''; 169 196 } 170 197 … … 175 202 sb_color_scheme = ''; 176 203 sb_height = ''; 204 sb_featured_height = ''; 205 sb_min_height = ''; 206 sb_excerpt_show = ''; 207 sb_excerpt_lenght = ''; 208 sb_ignore_more_tag = ''; 177 209 } 178 210 … … 189 221 sb_show_date_before_title = ''; 190 222 sb_height = ''; 223 sb_featured_height = ''; 224 sb_min_height = ''; 225 sb_excerpt_show = ''; 226 sb_excerpt_lenght = ''; 227 sb_ignore_more_tag = ''; 191 228 } 192 229 … … 229 266 shortcode += ' height="' + sb_height + '"'; 230 267 } 268 if (sb_featured_height != '') { 269 shortcode += ' featured_height="' + sb_featured_height + '"'; 270 } 271 if (sb_min_height != '') { 272 shortcode += ' min_height="' + sb_min_height + '"'; 273 } 231 274 if (sb_space_hor != '') { 232 275 shortcode += ' space_hor="' + sb_space_hor + '"'; … … 264 307 if (sb_dropcap_text_color != '') { 265 308 shortcode += ' text_color="' + sb_dropcap_text_color + '"'; 309 } 310 if (sb_excerpt_show != '') { 311 shortcode += ' excerpt_show="' + sb_excerpt_show + '"'; 312 } 313 if (sb_excerpt_lenght != '') { 314 shortcode += ' excerpt_lenght="' + sb_excerpt_lenght + '"'; 315 } 316 if (sb_ignore_more_tag != '') { 317 shortcode += ' ignore_more_tag="' + sb_ignore_more_tag + '"'; 266 318 } 267 319 if (sb_show_date_before_title != '') { -
advanced-recent-posts/trunk/lptw-recent-posts.css
r1191281 r1194206 1 /* version 0.6.1 1*/1 /* version 0.6.12 */ 2 2 /*-------------------------------------------------------------- 3 3 >>> TABLE OF CONTENTS: … … 412 412 * -------------------------- GRID LAYOUT -------------------------- */ 413 413 414 #grid-container {414 .lptw-container { 415 415 overflow: hidden; 416 416 } 417 418 .grid-layout .overlay { 419 display: none; 420 } 417 421 418 422 .lptw-post-grid-img { … … 445 449 } 446 450 .lptw-grid-element { 447 min-height: 400px;451 /*min-height: 400px;*/ 448 452 overflow: hidden; 449 453 box-sizing: border-box; -
advanced-recent-posts/trunk/lptw-recent-posts.php
r1191281 r1194206 5 5 Description: Plugin that shows the recent posts with thumbnails in the widget and in other parts of the your blog or theme with shortcodes. 6 6 Tags: widget, posts, plugin, recent, recent posts, latest, latest posts, shortcode, thumbnail, thumbnails, categories, content, featured image, Taxonomy, custom post type, custom 7 Version: 0.6.1 17 Version: 0.6.12 8 8 Author: Eugene Holin 9 9 Author URI: http://lp-tricks.com/ … … 27 27 28 28 /* trim excerpt to custom size */ 29 function lptw_custom_excerpt ($limit) { 30 $excerpt = explode(' ', get_the_excerpt(), $limit); 31 if (count($excerpt)>=$limit) { 29 function lptw_custom_excerpt ($limit, $ignore_more_tag) { 30 global $more; 31 if ($ignore_more_tag == 'true') { $more = 1; } 32 else { $more = 0; } 33 $excerpt = explode(' ', get_the_excerpt(), $limit); 34 if (count($excerpt)>=$limit) { 32 35 array_pop($excerpt); 33 36 $excerpt = implode(" ",$excerpt).'...'; 34 } else {37 } else { 35 38 $excerpt = implode(" ",$excerpt); 36 }37 $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);38 return $excerpt;39 39 } 40 $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); 41 return $excerpt; 42 } 40 43 41 44 register_activation_hook( __FILE__, 'lptw_recent_posts_activate' ); … … 950 953 } 951 954 952 953 955 /** 954 956 -------------------------------------- Shortcode -------------------------------------- … … 973 975 'columns' => '1', 974 976 'height' => '', 977 'featured_height' => '400', 978 'min_height' => '400', 975 979 'width' => '300', 976 980 'date_format' => 'd.m.Y', … … 989 993 'tags_id' => '', 990 994 'tags_exclude' => 'false', 991 'override_colors' => 'false' 995 'override_colors' => 'false', 996 'excerpt_show' => 'true', 997 'excerpt_lenght' => '35', 998 'ignore_more_tag' => 'false' 992 999 ), $atts ); 993 1000 … … 1063 1070 break; 1064 1071 case 'grid-medium': 1065 $content .= '<div id="grid-container">'; 1072 $rand_grid = rand(11111, 99999); 1073 $content .= '<div class="lptw-container" id="lptw-grid-'.$rand_grid.'">'; 1066 1074 break; 1067 1075 } 1068 1076 while( $lptw_shortcode_query->have_posts() ) { 1069 1077 $lptw_shortcode_query->the_post(); 1078 /* 1079 echo '<pre>'; 1080 echo $lptw_shortcode_query->post->ID; 1081 echo $lptw_shortcode_query->post->post_excerpt; 1082 echo '</pre>'; 1083 */ 1070 1084 1071 1085 $element_style_args = Array(); … … 1181 1195 </article>'; 1182 1196 1183 /* recent posts with thumbnail and featured posts */1197 /* Responsive Grid - recent posts with thumbnail and featured posts */ 1184 1198 } elseif ($a['layout'] == 'grid-medium' ) { 1199 $featured_height = $a['featured_height'] . 'px'; 1185 1200 if ($a['fluid_images'] == 'true') { 1186 1201 $base_width = (100 / $a['columns']) - 1; … … 1193 1208 1194 1209 if ( $a['height'] > 0 ) { $element_style_args[] = 'height: '.$a['height'].'px;'; } 1210 if ( $a['excerpt_show'] == 'false' ) { $element_style_args[] = 'padding-bottom: 0.5rem;'; } 1211 if ( $a['min_height'] > 0 ) { $element_style_args[] = 'min-height: '.$a['min_height'].'px;'; } 1195 1212 1196 1213 if ( $a['override_colors'] == 'true' ) { … … 1204 1221 1205 1222 $element_style_args[] = 'width: ' . $featured_width . ';'; 1223 $element_style_args[] = 'min-height: ' . $featured_height . ';'; 1206 1224 $element_style_args[] = 'background: url('.$url_grid.') center center no-repeat;'; 1207 1225 $element_style_args[] = 'background-size: cover;'; … … 1244 1262 $content .= '</div> 1245 1263 </header>'; 1246 if ( has_excerpt( $post_id ) ) { 1247 $my_excerpt = get_the_excerpt(); 1248 $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $my_excerpt . '</content>'; 1249 } else { 1250 $my_excerpt = lptw_custom_excerpt(35); 1251 $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $my_excerpt . '</content>'; 1264 if ($a['excerpt_show'] == 'true') { 1265 $manual_excerpt = $lptw_shortcode_query->post->post_excerpt; 1266 if ( !empty($manual_excerpt) ) { 1267 $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $manual_excerpt . '</content>'; 1268 } else { 1269 $my_excerpt = lptw_custom_excerpt($a['excerpt_lenght'], $a['ignore_more_tag']); 1270 $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'" '.$user_text_color.'>' . $my_excerpt . '</content>'; 1271 } 1252 1272 } 1253 1273 $content .= '</article>'; … … 1260 1280 if ($a['layout'] == 'grid-medium') { 1261 1281 $content .= '<script> 1262 jQuery(document).ready(function($) { 1263 var $container = $("#grid-container"); 1282 jQuery(window).on("load", function() { 1283 var $ = jQuery; 1284 $(".overlay").css("display", "block"); 1285 var $container = $("#lptw-grid-'.$rand_grid.'"); 1264 1286 var fluid_images = '.$a['fluid_images'].'; 1265 1287 var countedColumnWidth; -
advanced-recent-posts/trunk/readme.txt
r1191281 r1194206 80 80 == Changelog == 81 81 82 = 0.6.12 = 83 * Added the Post Excerpt settings: now you can show or hide an Excerpt of all Posts in the Responsive Grid, also you can set the Post Excerpt lenght and use or ignore <!-- more --> tag. 84 * Added new settings of Post height in the Responsive Grid: 85 * Height of a Featured Post 86 * The minimal height of all Posts 87 * Fixed issue with incorect height of elements of the Responsive Grid in Chrome and Safari 88 * Fixed issue with incorrect work of two or more shortcodes on the page 89 82 90 = 0.6.11 = 83 91 * Added text color setting for Basic Layout
Note: See TracChangeset
for help on using the changeset viewer.