Changeset 537752
- Timestamp:
- 04/28/2012 09:59:19 PM (14 years ago)
- Location:
- akfeatured-post-widget
- Files:
-
- 2 edited
- 5 copied
-
tags/1.4.1/trunk (copied) (copied from akfeatured-post-widget/trunk)
-
tags/1.4.1/trunk/ak_featured_post.php (copied) (copied from akfeatured-post-widget/trunk/ak_featured_post.php)
-
tags/1.4.1/trunk/readme.txt (copied) (copied from akfeatured-post-widget/trunk/readme.txt)
-
tags/1.4.1/trunk/screenshot-1.png (copied) (copied from akfeatured-post-widget/trunk/screenshot-1.png)
-
tags/1.4.1/trunk/screenshot-2.png (copied) (copied from akfeatured-post-widget/trunk/screenshot-2.png)
-
trunk/ak_featured_post.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
akfeatured-post-widget/trunk/ak_featured_post.php
r534525 r537752 4 4 Plugin URI: http://cssboss.com/featured_post 5 5 Description: Easily configure this widget to display any amount of posts (from 1 to 99) from a category into any widgetized area of your blog. Video is more my style, so check out this video tutorial I made for the plugin <a href="http://www.youtube.com/watch?v=eWhafkO7uJQ">Here</a> 6 Version: 1. 4.16 Version: 1.5 7 7 Author: Andrew Kaser 8 8 Author URI: http://www.andrewkaser.com … … 58 58 if (isset($instance['show_featured_image'])){ $show_featured_image = $instance['show_featured_image']; } else { $show_featured_image = __('checked','text_domain'); } 59 59 if (isset($instance['show_support_link'])){ $show_support_link = $instance['show_support_link']; } else { $show_support_link = __('checked','text_domain'); } 60 if (isset($instance['order_post'])){ $order_post = $instance['order_post']; } else { $order_post = __('DESC','text_domain'); } 61 60 62 ?> 61 63 <p> … … 63 65 <input class="widefat" id="<?php echo $this->get_field_id( 'show_post_limit' ); ?>" name="<?php echo $this->get_field_name( 'show_post_limit' ); ?>" type="text" value="<?php echo esc_attr( $show_post_limit ); ?>" maxlength="2" style="width: 25px;" /> 64 66 </p> 65 67 <p> 68 <label for="<?php echo $this->get_field_id('order_post'); ?>"><?php _e('Order Posts:'); ?></label> 69 <select id="<?php echo $this->get_field_id( 'order_post' ); ?>" name="<?php echo $this->get_field_name( 'order_post' ); ?>" > 70 <option value="ASC" <?php if ( $order_post == "ASC" ) { echo 'selected="selected"'; } ?>>Oldest to Newest</option> 71 <option value="DESC" <?php if ( $order_post == "DESC" ) { echo 'selected="selected"'; } ?>>Newest to Oldest</option> 72 </select> 73 </p> 66 74 <p> 67 75 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> … … 107 115 <input id="<?php echo $this->get_field_id( 'show_support_link' ); ?>" name="<?php echo $this->get_field_name( 'show_support_link' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_support_link ); ?>" <?php checked( (bool) $show_support_link, true ); ?> /> 108 116 </p> 117 <p><a href="http://csss.boss.com/donate">Donate</a> - <a href="http://www.cssboss.com">CSSBoss.com</a></p> 109 118 <?php 110 119 } … … 115 124 $instance = array(); 116 125 $instance['show_post_limit'] = strip_tags( $new_instance['show_post_limit'] ); 126 $instance['order_post'] = strip_tags( $new_instance['order_post']); 117 127 $instance['category'] = strip_tags( $new_instance['category'] ); 118 128 $instance['link_title_to_cat'] = ( isset( $new_instance['link_title_to_cat'] ) ? 1 : 0 ); … … 135 145 $title = apply_filters( 'widget_title', $instance['title'] ); 136 146 $category = $instance['category']; 147 $order_post = $instance['order_post']; 137 148 $link_title_to_cat = $instance['link_title_to_cat']; 138 149 $show_post_title = $instance['show_post_title']; … … 151 162 } 152 163 153 $ak_featured_posts_query = new WP_Query( 'cat='.$category.'&showposts='.$show_post_limit ); // get new post data 164 echo "<ul>"; // thanks Dan ;) 165 166 $ak_featured_posts_query = new WP_Query( 'cat='.$category.'&showposts='.$show_post_limit.'&order='.$order_post ); // get new post data 154 167 while ( $ak_featured_posts_query->have_posts() ) : $ak_featured_posts_query->the_post(); 155 168 $image_title = get_the_title(); // The alt text for the featured image … … 158 171 <a href="<?php the_permalink(); ?>"> 159 172 <?php 160 if ($show_post_title) 173 if ($show_post_title) // To show the title of the post, or not... That is the question 161 174 { 162 the_title(); // To show the title of the post, or not... That is the question175 the_title(); 163 176 } 164 177 … … 181 194 endwhile; 182 195 196 echo "</ul>"; 197 183 198 if ( $show_support_link ) 184 199 { -
akfeatured-post-widget/trunk/readme.txt
r534525 r537752 5 5 Requires at least: 3.3.1 6 6 Tested up to: 3.3.2 7 Stable tag: 1. 4.17 Stable tag: 1.5 8 8 9 9 A widget that you can use to display posts from a category … … 56 56 == Change Log == 57 57 58 = 1.5 = 59 Included proper html syntax 60 Added ordering of post by either ascending or descending 61 58 62 = 1.4.1 = 59 63 It's a secret bwahhahaha … … 81 85 == Upgrade Notice == 82 86 87 = 1.5 = 88 Order your post, Select specific posts, display proper html, upgrading is a must! 89 83 90 = 1.3 = 84 91 Added additional functionality, and fixed a few bugs!
Note: See TracChangeset
for help on using the changeset viewer.