Changeset 1177287
- Timestamp:
- 06/09/2015 08:26:23 AM (11 years ago)
- Location:
- advanced-recent-posts/trunk
- Files:
-
- 2 edited
-
lptw-recent-posts.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-recent-posts/trunk/lptw-recent-posts.php
r1166332 r1177287 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. 57 Version: 0.6.6 8 8 Author: Eugene Holin 9 9 Author URI: http://lp-tricks.com/ … … 17 17 wp_enqueue_style( 'lptw-style' ); 18 18 19 wp_enqueue_script( 'jquery-masonry' ); 20 21 wp_enqueue_script( 'lptw-recent-posts-script', plugins_url( 'lptw-recent-posts.js', __FILE__ ), array(), '0.5', true ); 19 wp_enqueue_script( 'lptw-recent-posts-script', plugins_url( 'lptw-recent-posts.js', __FILE__ ), array('jquery', 'jquery-masonry'), '0.5', true ); 22 20 } 23 24 21 add_action( 'wp_enqueue_scripts', 'lptw_recent_posts_register_scripts' ); 25 22 … … 30 27 31 28 /* trim excerpt to custom size */ 32 function custom_excerpt ($limit) {29 function lptw_custom_excerpt ($limit) { 33 30 $excerpt = explode(' ', get_the_excerpt(), $limit); 34 31 if (count($excerpt)>=$limit) { … … 945 942 **/ 946 943 947 // all-news-small-thumb948 949 944 function lptw_display_recent_posts ( $atts ) { 950 945 $default_posts_per_page = get_option( 'posts_per_page', '10' ); … … 1020 1015 } 1021 1016 1022 $ args = array(1017 $lptw_shortcode_query_args = array( 1023 1018 'post_type' => $a['post_type'], 1024 1019 'posts_per_page' => $a['posts_per_page'], … … 1035 1030 ); 1036 1031 1037 $ allnews = new WP_Query( $args );1038 if( $ allnews->have_posts() ) {1039 if ($a['reverse_post_order'] == 'true') { $ allnews->posts = array_reverse($allnews->posts); }1032 $lptw_shortcode_query = new WP_Query( $lptw_shortcode_query_args ); 1033 if( $lptw_shortcode_query->have_posts() ) { 1034 if ($a['reverse_post_order'] == 'true') { $lptw_shortcode_query->posts = array_reverse($lptw_shortcode_query->posts); } 1040 1035 $i=0; 1041 1036 $content = ''; 1042 1037 if ($a['layout'] == 'grid-medium') {$content .= '<div id="grid-container">';} 1043 while( $ allnews->have_posts() ) {1044 $ allnews->the_post();1038 while( $lptw_shortcode_query->have_posts() ) { 1039 $lptw_shortcode_query->the_post(); 1045 1040 1046 1041 $post_id = get_the_ID(); … … 1178 1173 $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'">' . $my_excerpt . '</content>'; 1179 1174 } else { 1180 $my_excerpt = custom_excerpt(35);1175 $my_excerpt = lptw_custom_excerpt(35); 1181 1176 $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'">' . $my_excerpt . '</content>'; 1182 1177 } … … 1186 1181 1187 1182 $i++; 1188 } // end while( $ allnews->have_posts() )1183 } // end while( $lptw_shortcode_query->have_posts() ) 1189 1184 if ($a['layout'] == 'grid-medium') {$content .= '</div>';} 1190 return $content;1191 1185 } else { 1192 return__( 'No recent posts', 'lptw_recent_posts_domain' );1186 $content = __( 'No recent posts', 'lptw_recent_posts_domain' ); 1193 1187 } 1188 wp_reset_postdata(); 1189 return $content; 1194 1190 } 1195 1191 … … 1208 1204 wp_enqueue_style('lptw-recent-posts-backend-style' ); 1209 1205 1210 // Add the color picker css and js files1206 // Add the color picker css styles 1211 1207 wp_enqueue_style( 'wp-color-picker' ); 1212 wp_enqueue_script( 'wp-color-picker' );1213 1208 1214 1209 wp_enqueue_script( 'lptw-shortcode-builder-script', plugins_url ( 'backend/lptw-recent-posts-shortcode-builder.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); … … 1219 1214 1220 1215 wp_enqueue_script( 'chosen-script', plugins_url ( 'backend/chosen/chosen.jquery.min.js', __FILE__ ), array(), '1.4.2', true ); 1221 1222 // Include our custom jQuery file with WordPress Color Picker dependency1223 //wp_enqueue_script( 'custom-script-handle', plugins_url( 'custom-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );1224 1216 } 1225 1217 add_action( 'admin_enqueue_scripts', 'lptw_recent_posts_backend_scripts' ); 1226 1218 1227 1219 /* include shortcode builder */ 1228 //include( plugin_dir_path( __FILE__ ) . 'backend/color-picker.php');1229 1220 include( plugin_dir_path( __FILE__ ) . 'backend/lptw-recent-posts-backend.php'); 1230 1221 -
advanced-recent-posts/trunk/readme.txt
r1166332 r1177287 4 4 Requires at least: 3.5 5 5 Tested up to: 4.2.2 6 Stable tag: 0.6. 56 Stable tag: 0.6.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 80 80 == Changelog == 81 81 82 = 0.6.6 = 83 * Fixed issue with incorrect interaction with other posts, comments, plug-ins, etc., which displays the content on the same page, which is inserted a shortcode. 84 82 85 = 0.6.5 = 83 86 * Changes in the widgets and shortcodes - now you can exclude the Posts without Featured Image from the Posts list.
Note: See TracChangeset
for help on using the changeset viewer.