Plugin Directory

Changeset 556161


Ignore:
Timestamp:
06/11/2012 03:00:54 PM (14 years ago)
Author:
dgilfoy
Message:

Added orderby capabilities

Location:
posts-in-page/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • posts-in-page/trunk/posts_in_page.php

    r554359 r556161  
    1111    [ic_add_post id='1'] - show a single post with the given ID ( must give post type if not post )
    1212    [ic_add_posts showposts='5'] - limit number of posts (or override default setting)
     13    [ic_add_posts orderby='title' order='ASC'] - orderby title - supports all WP orderby variables.  Order is optional, WP default
    1314    [ic_add_posts category='category-slug']  - Show posts within a specific category.  Uses slugs, can have multiple but separate by commas. category-1,category2, etc (no spaces.)
    1415    [ic_add_posts post_type='post-type'] - Show posts that are a specific post type (only one post type right now)
     
    3637            'tag' => false,
    3738            'template' => false,
    38             'ids' => false
     39            'ids' => false,
     40            'orderby' => false,
     41            'order' => false
    3942        ), $atts ) );
    4043        self::set_args( $atts );
     
    7275            $this->args['post_in'] = $post_ids;
    7376            $this->args['posts_per_page'] = count( $post_ids );
     77        }
     78        if( $atts['orderby'] ){
     79            $this->args['orderby'] = $atts['orderby'];
     80            if( $atts['order'] ) $this->args['order'] = $atts['order'];
    7481        }
    7582        if( $atts['template'] ) $this->args['template'] = $atts['template'];
  • posts-in-page/trunk/readme.txt

    r554364 r556161  
    3030
    3131Shortcode usage:
    32     * [ic_add_posts]  - Add all posts to a page (limit to what number posts in wordpress is set to), essentially adds blog "page" to page.
    33     * [ic_add_posts post_type='post_type' ids='1,2,3'] - show posts with certain IDs (currently only one post type per category)
    34     * [ic_add_post id='1'] - show a single post with the given ID ( must give post type if not post )
    35     * [ic_add_posts showposts='5'] - limit number of posts (or override default setting)
    36     * [ic_add_posts category='category-slug']  - Show posts within a specific category.  Uses slugs, can have multiple but separate by commas.   category-1,category2, etc (no spaces.)
    37     * [ic_add_posts post_type='post-type'] - Show posts that are a specific post type (only one post type right now)
    38     * [ic_add_posts tax='taxonomy' term='term'] - limit posts to those that exist in a taxonomy and have a specific term.  Both are required for either one to work
    39     * [ic_add_posts template='template-in-theme-dir.php'] - In case you want to style your markup, add meta data, etc.  Each shortcode can reference a different template.  These templates must exist in the theme directory.
     32*   [ic_add_posts]  - Add all posts to a page (limit to what number posts in wordpress is set to), essentially adds blog "page" to page.
     33*   [ic_add_posts post_type='post_type' ids='1,2,3'] - show posts with certain IDs (currently only one post type per category)
     34*   [ic_add_post id='1'] - show a single post with the given ID ( must give post type if not post )
     35*    [ic_add_posts showposts='5'] - limit number of posts (or override default setting)
     36*    [ic_add_posts orderby='title' order='ASC'] - orderby title - supports all WP orderby variables.  Order is optional, WP default
     37*   [ic_add_posts category='category-slug']  - Show posts within a specific category.  Uses slugs, can have multiple but separate by commas.     category-1,category2, etc (no spaces.)
     38*   [ic_add_posts post_type='post-type'] - Show posts that are a specific post type (only one post type right now)
     39*   [ic_add_posts tax='taxonomy' term='term'] - limit posts to those that exist in a taxonomy and have a specific term.  Both are required for either one to work
     40*   [ic_add_posts template='template-in-theme-dir.php'] - In case you want to style your markup, add meta data, etc.  Each shortcode can reference a different template.  These templates must exist in the theme directory.
    4041    Or any combination above.
    4142
Note: See TracChangeset for help on using the changeset viewer.