Changeset 656876
- Timestamp:
- 01/22/2013 01:42:54 PM (13 years ago)
- Location:
- featured-post
- Files:
-
- 2 edited
-
tags/2.0.1/readme.txt (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
featured-post/tags/2.0.1/readme.txt
r656856 r656876 58 58 As mentioned earlier, this is just a simple featured posts management plugin that adds the post meta data as featured=yes for the particular post marked as featured. 59 59 60 = Does This Support Custom Post Type? = 61 Yes, it does. To display featured post of any Custom Post Type pass the arguement `post_type=YOUR_POST_TYPE` along with `featured=yes`. For example, if I have custom post type "portfolio" and I want to show featured posts in post type "portfolio' (so called featured portfolio), then I would do, `query_posts('post_type=portfolio&featured=yes')` before the `have_posts()` loop. 62 63 = Does it work with WP_Query() class? = 64 Yes, absolutely, it does. you can pass it as string type arguement like `$query=new WP_Query('post_type=portfolio&featured=yes&posts_per_page=1')` or even in array type arguement like `$query=new WP_Query(array('post_type'=>'portfolio','featured'=>'yes'));` then use how the regular WP_Query is used. 65 66 = How Does it work exactly? = 67 This plugin actually hooks over `pre_get_posts` filter and make the WP_Query class to only fetch posts/entries which are marked featured whenever featured=yes query var is passed as query arguement(Hope that makes sense). 60 68 61 69 -
featured-post/trunk/readme.txt
r656856 r656876 58 58 As mentioned earlier, this is just a simple featured posts management plugin that adds the post meta data as featured=yes for the particular post marked as featured. 59 59 60 = Does This Support Custom Post Type? = 61 Yes, it does. To display featured post of any Custom Post Type pass the arguement `post_type=YOUR_POST_TYPE` along with `featured=yes`. For example, if I have custom post type "portfolio" and I want to show featured posts in post type "portfolio' (so called featured portfolio), then I would do, `query_posts('post_type=portfolio&featured=yes')` before the `have_posts()` loop. 62 63 = Does it work with WP_Query() class? = 64 Yes, absolutely, it does. you can pass it as string type arguement like `$query=new WP_Query('post_type=portfolio&featured=yes&posts_per_page=1')` or even in array type arguement like `$query=new WP_Query(array('post_type'=>'portfolio','featured'=>'yes'));` then use how the regular WP_Query is used. 65 66 = How Does it work exactly? = 67 This plugin actually hooks over `pre_get_posts` filter and make the WP_Query class to only fetch posts/entries which are marked featured whenever featured=yes query var is passed as query arguement(Hope that makes sense). 60 68 61 69
Note: See TracChangeset
for help on using the changeset viewer.