Changeset 551516
- Timestamp:
- 05/31/2012 06:50:47 PM (14 years ago)
- Location:
- lazy-content-slider/tags/2.1
- Files:
-
- 2 edited
-
lzcs.php (modified) (4 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lazy-content-slider/tags/2.1/lzcs.php
r551510 r551516 5 5 Description: This is a content slider that shows 5 slides from a "Featured Category" 6 6 Author: Lee Thompson 7 Version: 2. 27 Version: 2.1 8 8 Author URI: http://mysqlhow2.com 9 9 … … 90 90 } 91 91 92 function getDisplayPosts($limit = 4) 93 { 92 function drawslider() { 93 global $post; 94 echo "<div id=\"featured\" >"; 95 echo "<ul class=\"ui-tabs-nav\">"; 94 96 $posts = get_option('lzcs_cat'); 95 97 $args = array('category' => $posts ); 96 98 $recent_posts = wp_get_recent_posts( $args ); 97 98 $output = array(); 99 foreach ($recent_posts as $post) { 100 setup_postdata($post); 101 if (has_post_thumbnail($post['ID'])) { 102 $output[] = $post; 103 } 104 105 if (count($output) > $limit) break; 106 } 107 108 return $output; 109 } 110 111 function drawslider() { 112 global $post; 113 $recent_posts = getDisplayPosts(); 114 115 if (count($recent_posts) == 0) { 116 return; 117 } 118 119 echo "<div id=\"featured\" >"; 120 echo "<ul class=\"ui-tabs-nav\">"; 121 99 100 $limit = 4; 101 $displayedPosts = 0; 102 122 103 foreach( $recent_posts as $recent ){ 123 104 setup_postdata($recent); 124 105 $postid = $recent["ID"]; 125 106 if (!has_post_thumbnail($postid)) { 107 continue; 108 } 109 110 if (++$displayedPosts > $limit) break; 111 126 112 $thumbnail = get_the_post_thumbnail( $postid, array(50, 50) ); 127 113 … … 138 124 echo '</ul>'; // Closing the div.ui-tabs-nav 139 125 140 126 $displayedPosts = 0; 127 141 128 foreach( $recent_posts as $recent ){ 142 129 $postid = $recent["ID"]; … … 145 132 $postexcerpt = string_limit_words($postexcerpt,15); 146 133 134 if (!has_post_thumbnail($postid)) { 135 continue; 136 } 137 138 if (++$displayedPosts > $limit) break; 139 147 140 $largeimage = get_the_post_thumbnail( $postid, array(400, 250)); 148 141 ?> -
lazy-content-slider/tags/2.1/readme.txt
r551510 r551516 5 5 Requires at least: 2.9.2 6 6 Tested up to: 3.3.2 7 Stable tag: 2. 27 Stable tag: 2.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 51 51 52 52 == Frequently Asked Questions == 53 Just want to give shout out to Tim Garrison [http://www.skudd.com/]who helped with my looping and53 Just want to give shout out to Tim Garrison who helped with my looping and 54 54 webdeveloperplus with the great tutorial on the slider using jquery. 55 55 … … 71 71 = 2.1 = 72 72 Added Excerpt to div.info 73 = 2.2 =74 Refactored to not show the div if no thumbnail-enabled posts are found -75 tgarrison76 73 77 74 … … 92 89 = 2.1 = 93 90 Added Excerpt to div.info 94 = 2.2 =95 Refactored to not show the div if no thumbnail-enabled posts are found -96 tgarrison97
Note: See TracChangeset
for help on using the changeset viewer.