Changeset 519660
- Timestamp:
- 03/16/2012 02:44:47 AM (14 years ago)
- Location:
- post-tiles/trunk
- Files:
-
- 2 edited
-
post-tiles.php (modified) (6 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-tiles/trunk/post-tiles.php
r517667 r519660 5 5 Description: This plugin displays recent posts as tiles. Posts can choose categories by id and numbeer of posts to display. Example shortcode: <strong>[post-tiles]</strong> or <strong>[post-tiles categories="1,2,4,10" posts="8" excerpt="18"]</strong>. 6 6 Author: Ethan Hackett - TinCrate 7 Version: 1.2. 47 Version: 1.2.5 8 8 Author URI: http://www.tincrate.com/plugins 9 9 … … 227 227 228 228 // Configure Both Categories and Number of Posts For Query 229 $excerpt = $atts['excerpt']; 230 if (empty($excerpt)) { 231 $excerpt = '19'; 232 } 233 define("pt_excerpt", $excerpt); 234 229 $excerpt_length = $atts['excerpt']; 235 230 236 231 // Configure Categories For Query … … 287 282 $temp_link = get_permalink($post->ID); 288 283 $temp_excerpt = get_the_excerpt($post->ID); 284 285 // Check to see if the excerpt was not defined thus empty 286 if ($excerpt_length == "") { 287 // Set excerpt length to 19 as default. 288 $excerpt_length = '19'; 289 } 290 // Truncates the excerpt length (Not using default wordpress for plugin conflicts) 291 $words = explode(' ', $temp_excerpt); 292 if (count($words) > $excerpt_length){ 293 array_splice($words, $excerpt_length); 294 $temp_excerpt = implode(' ', $words); 295 $temp_excerpt .= '…'; 296 } 297 298 299 289 300 290 301 // Grabs the categories then assigns the first category in the string to the class. … … 305 316 } 306 317 307 // Retrieve the option feature image 318 // Retrieve the option feature image. 308 319 $featured_images_key = get_option('featured-images'); 309 // See if Featured image is true 320 // See if Featured image is true. 310 321 // Clear features_style variable. 311 322 $featured_style = ""; 323 // Get the post ID. 324 $theID = get_the_ID(); 312 325 // If there is a featured image. 313 326 if ($featured_images_key == "true") { 314 327 if ( has_post_thumbnail()) { 315 328 // Retrieve the featured image. 316 $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), ' full');329 $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'medium'); 317 330 // Strip featured image down to the url. 318 331 $url = $thumb['0']; … … 321 334 } 322 335 // Each output creates the li > link > title > exerpt 323 $output .= "<li ".$featured_style." ><a href='$temp_link' class='".$cat_var."'style='background-color: $cat_var_value;'><h3>$temp_title</h3>$temp_excerpt</a></li>\n";336 $output .= "<li ".$featured_style." id='".$theID."'><a href='$temp_link' class='".$cat_var."'style='background-color: $cat_var_value;'><h3>$temp_title</h3>$temp_excerpt</a></li>\n"; 324 337 // Each output_key creates a li > category color block > category name 325 338 … … 386 399 // wp_enqueue_script('post-tiles', $plugin_url.'/post-tiles-frontend.js' ); 387 400 } 388 389 // Set's Excerpt Length390 add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );391 392 function custom_excerpt_length( $length ) {393 return pt_excerpt;394 }395 396 401 ?> -
post-tiles/trunk/readme.txt
r517675 r519660 5 5 Requires at least: 3.0 6 6 Tested up to: 3.3 7 Stable tag: 1.2. 47 Stable tag: 1.2.5 8 8 9 9 Post Tiles gives admins the ability to display their posts as tiles. The tiles are color coded by category. … … 21 21 *NOTE:* The category id numbers are listed below, next to the category names. You can use both the categories and posts attributes **Example: [post-tiles categories='1,2,4' posts='8' excerpt='18']** 22 22 23 Version 1.2. 423 Version 1.2.5 24 24 25 25 == Installation == … … 32 32 == Screenshots == 33 33 34 1. The admin panel gives you the flexibility to use a color picker and define the background color of each category screenshot-1.jpg.35 2. The front end output displays your posts in a tiled format screenshot-2.jpg.34 1. The admin panel gives you the flexibility to use a color picker and define the background color of each category /tags/1.2.5/screenshot-1.png 35 2. The front end output displays your posts in a tiled format /tags/1.2.5/screenshot-2.png 36 36 37 37 == Changelog == 38 39 = 1.2.5 = 40 * Fix the excerpt issue regarding truncation 38 41 39 42 = 1.2.4 =
Note: See TracChangeset
for help on using the changeset viewer.