Changeset 1453562
- Timestamp:
- 07/12/2016 03:37:33 PM (10 years ago)
- Location:
- post-shortcode
- Files:
-
- 8 edited
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-128x128.png (modified) (previous)
-
trunk/inc/pcs-menu.php (modified) (3 diffs)
-
trunk/inc/pcs-shortcode.php (modified) (6 diffs)
-
trunk/inc/pcs-widget.php (modified) (4 diffs)
-
trunk/post-shortcode.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (9 diffs)
-
trunk/screenshot-2.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
post-shortcode/trunk/inc/pcs-menu.php
r1430941 r1453562 94 94 } 95 95 } 96 if( isset($_POST['pagedvar']) && !empty($_POST['pagedvar'])){ 97 $shortcode .= " pagedvar='".$_POST['pagedvar']."'"; 98 } 96 99 $shortcode .= "]"; 97 100 echo "<h3>Generated Shortcode :</h3><textarea readonly class='pcs-ta'>". $shortcode."</textarea>"; … … 150 153 /* pcs style for Grid Widget Style as gws and Inverse Grid Widget Style as igws*/ 151 154 152 .gws .pcs-body,.igws .pcs-body{width: 100%;} 153 .gws .pcs-img,.igws .pcs-img{width: 100%} 154 155 .gws .pcs-body,.igws .pcs-body,.gcore .pcs-body{width: 100%;} 156 .gws .pcs-img,.igws .pcs-img,.gcore .pcs-img{width: 100%} 157 158 /* pcs style for pagination */ 159 160 .pcs-pagination{display: block;clear:both;overflow: hidden;} 161 .pcs-pagination ul {display: inline-block;padding: 0;margin: 10px 1px;border-radius: 50%;list-style-type: none;} 162 .pcs-pagination ul li {float: left} 163 .pcs-pagination ul li a,.pcs-pagination ul li span{float: left;padding: 10px 15px;line-height: 1.5;color: #0275d8;text-decoration: none;background-color: #fff;border: 1px solid #ddd;display: block;margin-left: -1px} 164 .pcs-pagination ul li a:hover,.pcs-pagination ul li span.current{background-color: #0275d8;color: #fff;} 155 165 <?php } ?></textarea> 156 166 <?php wp_nonce_field( $nonceval, 'nonce_of_pcs' ); ?> … … 328 338 <p class="submit"> 329 339 <?php wp_nonce_field( $nonceval, 'nonce_of_pcs' ); ?> 340 <input type="hidden" name="pagedvar" value="<?php echo uniqid(); ?>" /> 330 341 <input type="submit" name="pcs-code" id="submit" class="button button-primary" value="Generate Shortcode"> 331 342 </p> -
post-shortcode/trunk/inc/pcs-shortcode.php
r1430941 r1453562 24 24 'post__not_in' => '', 25 25 'post_name__in' => '', 26 'pagedvar' => 'paged', 26 27 ), $atts ); 27 28 if(function_exists('pcs_get_custom_post_output')){ … … 49 50 $args['post_type'] = explode(",", 'post'); 50 51 } 52 $showfield = (isset($showfield) && !empty($showfield)) ? $showfield : "title,thumbnail,excerpt"; 53 $ashowfield =explode(",", $showfield); 51 54 $args['post_status'] = array( 'publish' ); 52 55 $args['posts_per_page'] = (isset($postcount) && !empty($postcount)) ? $postcount : 3; … … 54 57 $taxrel = (isset($taxrel) && !empty($taxrel)) ? $taxrel : 'OR'; 55 58 $args['paged'] = (int) $paged; 59 $pagedvar = (isset($pagedvar) && !empty($pagedvar)) ? $pagedvar : "paged"; 60 if(in_array("pagination", $ashowfield)){ 61 $args['paged'] = 1; 62 if(isset($_GET['pagedvar']) && $_GET['pagedvar'] == $pagedvar ){ 63 $args['paged'] = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); 64 } 65 } 56 66 if(!empty($categories)): 57 67 $acat = explode(",", $categories); … … 83 93 $order = (isset($order) && !empty($order)) ? $order : "DESC"; 84 94 $args['order'] = $order; 85 $showfield = (isset($showfield) && !empty($showfield)) ? $showfield : "title,thumbnail,excerpt";86 $ashowfield =explode(",", $showfield);87 95 $tsize = (isset($tsize) && !empty($tsize)) ? $tsize : "thumbnail"; 88 96 $excerptl = (isset($excerptl) && !empty($excerptl)) ? $excerptl : 55; … … 93 101 } 94 102 } 95 //print_r($args);96 103 query_posts($args); 97 104 // The Loop … … 185 192 </div> 186 193 <?php 194 /** 195 * @version 2.0.7 196 * pagination code for query post 197 */ 198 if(in_array("pagination", $ashowfield)){ ?> 199 <nav class="pcs-pagination pcs-reset" > 200 <?php global $wp_query; 201 $big = 999999999; // need an unlikely integer 202 $asearch = array( $big, '#038;' ); 203 $areplace = array( '%#%', '&' ); 204 echo paginate_links( array( 205 'base' => str_replace( $asearch, $areplace, esc_url( get_pagenum_link( $big ) ) ), 206 'format' => '?paged=%#%', 207 'current' => max( 1, get_query_var('paged') ), 208 'total' => $wp_query->max_num_pages, 209 'type' => 'list', 210 'prev_text' => '«', 211 'next_text' => '»', 212 'add_args' => array( "pagedvar" => $pagedvar), 213 ) ); 214 ?> 215 </nav> 216 <?php 217 } 187 218 endif; 188 219 $output = ob_get_contents(); -
post-shortcode/trunk/inc/pcs-widget.php
r1430941 r1453562 47 47 if( isset($instance['paged']) && !empty($instance['paged']) ) $shortcode .= " paged='".$instance['paged']."'"; 48 48 if( isset($instance['taxrel']) && !empty($instance['taxrel']) ) $shortcode .= " taxrel='".$instance['taxrel']."'"; 49 if( isset($instance['pagedvar']) && !empty($instance['pagedvar']) ) $shortcode .= " pagedvar='".$instance['pagedvar']."'"; 49 50 /* old version support code upto 2.0.5 */ 50 51 $readmoretitle = (isset($instance['readmoretitle']) && !empty($instance['readmoretitle'])) ? $instance['readmoretitle'] : "" ; … … 100 101 $paged = (isset($instance['paged']) && ! empty( $instance['paged'] ) )? $instance['paged'] : 1; 101 102 $taxrel = (isset($instance['taxrel']) && ! empty( $instance['taxrel'] ) )? $instance['taxrel'] : "OR"; 103 $pagedvar = (isset($instance['pagedvar']) && ! empty( $instance['pagedvar'] ) )? $instance['pagedvar'] : ""; 102 104 103 105 foreach ($aft as $aftvalue => $aftkey ) { … … 275 277 }); 276 278 </script> 279 <input class="widefat" id="<?php echo $this->get_field_id( 'pagedvar' ); ?>" name="<?php echo $this->get_field_name( 'pagedvar' ); ?>" type="hidden" value="<?php if(!empty($pagedvar)){ echo esc_attr( $pagedvar );}else{ echo uniqid();} ?>"> 277 280 <?php 278 281 } … … 305 308 $instance['paged'] = ( ! empty( $new_instance['paged'] ) ) ? strip_tags( $new_instance['paged'] ) : 1; 306 309 $instance['taxrel'] = ( ! empty( $new_instance['taxrel'] ) ) ? strip_tags( $new_instance['taxrel'] ) : 'OR'; 310 $instance['pagedvar'] = ( ! empty( $new_instance['pagedvar'] ) ) ? strip_tags( $new_instance['pagedvar'] ) : ''; 307 311 foreach ($aft as $aftvalue => $aftkey ) { 308 312 if(isset($new_instance[$aftvalue]) && !empty($new_instance[$aftvalue])){ -
post-shortcode/trunk/post-shortcode.php
r1430941 r1453562 4 4 * Plugin URI: 5 5 * Description: This plugin is used for display posts in widget as well as shortcode. 6 * Version: 2.0. 66 * Version: 2.0.7 7 7 * Author: Sachin Jadhav 8 8 * Author URI: http://sachin8600.wordpress.com/ 9 9 * Requires at least: 3.8 10 * Tested up to: 4.5. 210 * Tested up to: 4.5.3 11 11 * 12 12 * Text Domain: pcs … … 45 45 "rand" => "Random order", 46 46 "comment_count" => "Order by number of comments", 47 "menu_order" => "Order by Page Order (menu_order) ",47 "menu_order" => "Order by page order (menu_order) ", 48 48 ); 49 49 /** … … 57 57 "igws" => "Inverse Grid Widget Style", 58 58 "core" => "Core Widget Style", 59 "gcore" => "Core Grid Widget Style", 59 60 ); 60 61 /** … … 72 73 "readme" => "Show read more link", 73 74 "category" => "Show post categories", 74 "tag" => "Show post tags", 75 "tag" => "Show post tags", 76 "pagination" => "Show pagination" 75 77 ); 76 78 /** … … 198 200 $this->define( 'PCS_IMG_URL',PCS_URL."images/" ); 199 201 $this->define( 'PCS_VERSION', $this->version ); 200 202 // array of text field of post parameter 201 203 $this->aft['post_parent__in'] = __( 'Post Parent In ( eg: 10,1,89 ) :', 'pcs' ); 202 204 $this->aft['post_parent__not_in'] = __( 'Post Parent Not In ( eg: 10,1,89 ) :', 'pcs' ); … … 204 206 $this->aft['post__not_in'] = __( 'Post Not In ( eg: 10,1,89 ) :', 'pcs' ); 205 207 $this->aft['post_name__in'] = __( 'Post Name In ( eg: hello-world,sample-page ) :', 'pcs' ); 206 208 // array of select field of related post 207 209 $this->ars['excerptl'] = __( 'Excerpt Length ( In words, eg: 55 ) :', 'pcs' ); 208 210 $this->ars['readmoretitle'] = __( 'Read More Title ( eg: Read more ) :', 'pcs' ); … … 278 280 .iws a:hover,.igws a:hover{color: #fff !important;} 279 281 /* pcs style for gws nad igws*/ 280 .gws .pcs-body,.igws .pcs-body{width: 100%;} 281 .gws .pcs-img,.igws .pcs-img{width: 100%} 282 .gws .pcs-body,.igws .pcs-body,.gcore .pcs-body{width: 100%;} 283 .gws .pcs-img,.igws .pcs-img,.gcore .pcs-img{width: 100%} 284 /* pcs style for pagination */ 285 .pcs-pagination{display: block;clear:both;overflow: hidden;} 286 .pcs-pagination ul {display: inline-block;padding: 0;margin: 10px 1px;border-radius: 50%;list-style-type: none;} 287 .pcs-pagination ul li {float: left} 288 .pcs-pagination ul li a,.pcs-pagination ul li span{float: left;padding: 10px 15px;line-height: 1.5;color: #0275d8;text-decoration: none;background-color: #fff;border: 1px solid #ddd;display: block;margin-left: -1px} 289 .pcs-pagination ul li a:hover,.pcs-pagination ul li span.current{background-color: #0275d8;color: #fff;} 282 290 </style> 283 291 <?php -
post-shortcode/trunk/readme.txt
r1430941 r1453562 2 2 Contributors: sachin8600 3 3 Donate link: 4 Tags: posts, post, shortcode, widget, custom, taxonomy, pages, page, css, layout, recent, thumbnail, themes 4 Tags: posts, post, shortcode, widget, custom, taxonomy, pages, page, css, layout, recent, thumbnail, themes, pagination 5 5 Requires at least: 3.8 6 Tested up to: 4.5. 26 Tested up to: 4.5.3 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 20 20 Display post widget with selection tools ( like grid view or listing view ) 21 21 22 Customize display output without editing plugin22 Customize plugin output using functions.php 23 23 24 24 Display post as well as custome post type … … 26 26 Display post with perticuler Taxonomy, Term, Category, Tag 27 27 28 Display post with selection like: Title, Image, Category, Tag, Cutome Field, Excerpt, Read More 28 Display post with selection like: Title, Image, Category, Tag, Cutome Field, Excerpt, Read More, Pagination 29 29 30 30 Easy to change plugin css from backend plugin page. … … 43 43 * "Requires at least" 3.8 44 44 45 * "Tested up to" 4.5. 245 * "Tested up to" 4.5.3 46 46 47 47 … … 94 94 = showfield = 95 95 showfield=title,thumbnail,excerpt //default showfield 96 other are: date,author,cc,content,readme,category,tag 96 other are: date,author,cc,content,readme,category,tag, pagination 97 97 98 98 = excerptl = 99 99 excerptl=55 //default excerpt length 100 100 101 = = readmoretitle ==101 = readmoretitle = 102 102 readmoretitle=Read more //Read more readmoretitle 103 103 … … 130 130 post_name__in= //default is empty 131 131 132 = pagedvar = 133 pagedvar= //default is paged, check uniqid(). 134 132 135 == Screenshots == 133 136 … … 137 140 138 141 == Changelog == 142 143 = 2.0.7 = 144 Adding pagination parameter in showfield, add core grid theme. (Note : if you change css from backend then please reset css for updating css. ) 145 139 146 = 2.0.6 = 140 147 Adding page parameters like post_parent__in, post_parent__not_in, post__in, post__not_in, post_name__in … … 166 173 167 174 == Upgrade Notice == 175 176 = 2.0.7 = 177 Adding pagination parameter in showfield, add core grid theme. (Note : if you change css from backend then please reset css for updating css. ) 178 168 179 = 2.0.6 = 169 180 Adding page parameter like post_parent__in, post_parent__not_in, post__in, post__not_in, post_name__in … … 176 187 Improve backend and add css edit option. 177 188 178 = 2.0.3 = n189 = 2.0.3 = 179 190 Improve layout and css. 180 191
Note: See TracChangeset
for help on using the changeset viewer.