{"id":112568,"date":"2011-05-24T08:00:00","date_gmt":"2011-05-24T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/moka-get-posts\/"},"modified":"2011-05-24T08:04:00","modified_gmt":"2011-05-24T08:04:00","slug":"moka-get-posts","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/moka-get-posts\/","title":{"rendered":"Moka Get Posts Shortcode"},"content":{"rendered":"<p>Provides a [moka-get-posts] <a href=\"https:\/\/codex.wordpress.org\/Shortcode_API\" rel=\"nofollow ugc\">shortcode<\/a> for displaying posts or pages using the get_posts function.   The shortcode accepts most parameters that you can pass to the <a href=\"https:\/\/codex.wordpress.org\/Template_Tags\/wp_nav_menu\" rel=\"nofollow ugc\">get_posts()<\/a> function.  Additional arguments are: show_fields=\u201dpost_content,post_excerpt,post_thumbnail\u201d (use post properties; additional fields include post_thumbnail and post_permalink), thumbnail_size=\u201dlarge\u201d (default: \u201cthumbnail\u201d to set post_thumbnail size), and permalink_title (default: \u201ctrue\u201d to wrap title in permalink).  To show posts or pages, add [get-posts category=\u201dNN\u201d] in the page or post body. To get pages, use the post_type parameter, e.g., [moka-get-posts post_type=\u201dpage\u201d].  You can also pass a template using shortcode content.  Use the %post_title% format to have fields substituted.  Substitution fields most be listed in the \u201cshow_fields\u201d argument.<\/p>\n<p>Note: unlike the get_posts function, this shortcode defaults to 99 items.  Override using the numberposts attribute.<\/p>\n<h4>Please Note<\/h4>\n<p>The default values are the same as for the <code>get_posts()<\/code> function (https:\/\/codex.wordpress.org\/Template_Tags\/get_posts) with the following exceptions:<\/p>\n<p>Standard Attributes<br \/>\n\u2018numberposts\u2019     => -1,<br \/>\n\u2018orderby\u2019         => \u2018post_date\u2019,<br \/>\n\u2018order\u2019           => \u2018DESC\u2019,<br \/>\n\u2018post_type\u2019       => \u2018post\u2019,<br \/>\n\u2018post_parent\u2019     => \u201d,<\/p>\n<p>Note:  \u2018post_parent\u2019 also supports a non-standard \u201cthis\u201d value, which will use the current post or page as its argument.<\/p>\n<p>Non-Standard Attributes<\/p>\n<p>\u2018show_fields\u2019     => \u2018post_title\u2019,<\/p>\n<p>Selects fields to include in output.  By default, post_title is shown. Other options are: post_excerpt, post_content, post_thumbnail, post_permalink<\/p>\n<p>\u2018thumbnail_size\u2019  => \u2018thumbnail\u2019,<\/p>\n<p>If \u2018post_thumbnail\u2019 is used in \u2018show_fields\u2019, this will determine the size of the thumbnail.<\/p>\n<p>\u2018permalink_title\u2019 => \u2018true\u2019,<\/p>\n<p>If true, wrap post_title with post_permalink.<\/p>\n<p>\u2018class_name\u2019      => \u2018get-posts\u2019,<\/p>\n<p>Can use an alternate classname for the wrapping div.  Use if a template is not provided.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Provides a [moka-get-posts] shortcode for displaying posts or pages using the get_posts function.   The shortcode accepts most parameters that you can \u2026<\/p>\n","protected":false},"author":65,"featured_media":309699,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Moka Get Posts Shortcode - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Provides a [moka-get-posts] shortcode for displaying posts or pages using the get_posts function. The shortcode accepts most parameters that you can \u2026"},"footnotes":""},"categories":[1],"tags":[31583,542,94],"class_list":["post-112568","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-get-posts","tag-posts","tag-shortcodes"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/112568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=112568"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/112568\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/309699"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=112568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=112568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=112568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}