Changeset 2281540
- Timestamp:
- 04/11/2020 03:48:35 PM (6 years ago)
- Location:
- vi-include-post-by/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
vi_include_post_by.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vi-include-post-by/trunk/readme.txt
r2278601 r2281540 3 3 Tags: get, params, shortcode, vars 4 4 Requires at least: 4.0 5 Tested up to: 5. 2.36 Version: 0.4.2004 035 Tested up to: 5.4 6 Version: 0.4.200411 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 Shortcodes allowing you to display any post basically anywhere... hopefully anywhere11 10 12 11 == Description == 13 12 14 Version 8 Plugin: Include Post By - provides your pages and posts with shortcodes allowing you to display other pages and posts inside them either by their ID or by category. 13 VI: Include Post By - provides your pages and posts with shortcodes allowing you to display other pages and posts inside them either by their ID or by post category. Options to display title,meta,content,thumbnail,excerpt,footer. 14 15 == Coming Soon == 16 17 More display options. Bootstrap Cards option. Custom class names with a header/body/footer element. 15 18 16 19 17 20 == Changelog == 21 22 = 0.4.200411 = 23 * Fixed: offset now works as expected. 24 * Was previously only working for pageination, it now works with both pageination AND a starting offset. 25 18 26 19 27 = 0.4.200403 = -
vi-include-post-by/trunk/vi_include_post_by.php
r2278601 r2281540 3 3 Plugin Name: VI: Include Post By 4 4 Plugin URI: http://neathawk.com 5 Description: A collection of shortcodes to include posts inside other posts, etc6 Version: 0.4.2004 035 Description: Ability to include posts inside other posts/pages, etc, with a shortcode. 6 Version: 0.4.200411 7 7 Author: Joseph Neathawk 8 8 Author URI: http://Neathawk.com … … 56 56 pageinate = true/false 57 57 perpage = items per page. -1 = all 58 offset = how many to skip, useful if you are combining multiple of these58 offset = how many posts to skip, useful if you are combining multiple includes 59 59 display = from include-post-by-id 60 60 class= custom-class-name used in the internal element … … 565 565 } 566 566 567 //offest 567 //offest + offset_by_page 568 568 $page_current = 1; 569 $offset = 0; 569 $offset = intval($offset); 570 $offset_by_page = 0; 570 571 if( isset( $_GET['pn'] ) && is_numeric( $_GET['pn'] ) ) 571 572 { 572 573 $page_current = intval( $_GET['pn'] ); 573 $offset = ( $page_current - 1 ) * $perpage;574 if( $offset < 0 )574 $offset_by_page = ( $page_current - 1 ) * $perpage; 575 if( $offset_by_page < 0 ) 575 576 { 576 $offset = 0;577 $offset_by_page = 0; 577 578 } 578 579 } 579 else 580 { 581 $page_current = 1; 582 } 580 $offset += $offset_by_page; 583 581 584 582 $class = sanitize_text_field( $class ); … … 590 588 //count all posts 591 589 $post_count = 0; 592 $transient_name = 'v 8_' . md5( $intput_string ) . '_c';590 $transient_name = 'vi_' . md5( $intput_string ) . '_c'; 593 591 if( false === ( $post_count = get_transient( $transient_name ) ) ) 594 592 { … … 607 605 } 608 606 //get content for just the current page of posts 609 $transient_name = 'v 8_' . md5( $intput_string ) . '_' . $page_current;607 $transient_name = 'vi_' . md5( $intput_string ) . '_' . $page_current; 610 608 if( false === ( $post_array = get_transient( $transient_name ) ) ) 611 609 {
Note: See TracChangeset
for help on using the changeset viewer.