{"id":1224,"date":"2021-08-05T15:16:34","date_gmt":"2021-08-05T20:16:34","guid":{"rendered":"http:\/\/engage.augsburg.edu\/mannj\/?p=1224"},"modified":"2021-08-05T15:16:34","modified_gmt":"2021-08-05T20:16:34","slug":"show-posts-shortcode","status":"publish","type":"post","link":"https:\/\/engage.augsburg.edu\/mannj\/2021\/08\/05\/show-posts-shortcode\/","title":{"rendered":"Show Posts Shortcode"},"content":{"rendered":"\n<p>There is a show_posts shortcode that is available to use <strong>only on sites.augsburg.edu pages<\/strong>. The shortcode does what it says, it shows your posts!<\/p>\n\n\n\n<h3>Usage<\/h3>\n\n\n\n<p>You can use it like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[show_posts heading=\"My Heading\" category=\"my-category\" amount=\"6\"]<\/code><\/pre>\n\n\n\n<p>The shortcode, as you can see, takes three attributes: &#8216;heading&#8217;, &#8216;category&#8217; and &#8216;amount.&#8217; The heading attribute can be simple text. The category attribute should match a &#8220;Slug&#8221; for a category that is already defined under Posts &gt; Categories. If you go the Post &gt; Categories page the Slug has its own column in the Categories table, so you can take the value directly from there. The amount attribute is a number and it will control how many posts are shown, <strong>if you leave the amount attribute out all posts of that category will be displayed. <\/strong>For example: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[show_posts heading=\"My Heading\" category=\"my-category\"]<\/code><\/pre>\n\n\n\n<h3>Output<\/h3>\n\n\n\n<p>When the shortcode runs on a page, it will output the posts in a grid that will adapt to the width of you page and display as many posts as will fit into each row. It looks something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"500\" height=\"229\" src=\"https:\/\/engage.augsburg.edu\/mannj\/files\/2021\/08\/Screen-Shot-2021-08-05-at-3.06.25-PM-500x229.png\" alt=\"\" class=\"wp-image-1225\" srcset=\"https:\/\/engage.augsburg.edu\/mannj\/files\/2021\/08\/Screen-Shot-2021-08-05-at-3.06.25-PM-500x229.png 500w, https:\/\/engage.augsburg.edu\/mannj\/files\/2021\/08\/Screen-Shot-2021-08-05-at-3.06.25-PM-300x137.png 300w, https:\/\/engage.augsburg.edu\/mannj\/files\/2021\/08\/Screen-Shot-2021-08-05-at-3.06.25-PM-768x352.png 768w, https:\/\/engage.augsburg.edu\/mannj\/files\/2021\/08\/Screen-Shot-2021-08-05-at-3.06.25-PM-624x286.png 624w, https:\/\/engage.augsburg.edu\/mannj\/files\/2021\/08\/Screen-Shot-2021-08-05-at-3.06.25-PM.png 1425w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<h3>Reference<\/h3>\n\n\n\n<h4>Three Attributes<\/h4>\n\n\n\n<ul><li>heading: simple text &#8211; defaults to &#8220;Posts&#8221;<\/li><li>category: category slug &#8211; defaults to &#8220;uncategorized&#8221;<\/li><li>amount: number &#8211; defaults to show all<\/li><\/ul>\n\n\n\n<h4>Examples<\/h4>\n\n\n\n<p><strong>All attributes<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[show_posts heading=\"My Heading\" category=\"my-category\" amount=\"6\"]<\/code><\/pre>\n\n\n\n<p><strong>Show all posts in a category<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[show_posts heading=\"My Heading\" category=\"my-category\"]<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a show_posts shortcode that is available to use only on sites.augsburg.edu pages. The shortcode does what it says, it shows your posts! Usage You can use it like this: The shortcode, as you can see, takes three attributes: &#8216;heading&#8217;, &#8216;category&#8217; and &#8216;amount.&#8217; The heading attribute can be simple text. The category attribute should [&hellip;]<\/p>\n","protected":false},"author":888,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/posts\/1224"}],"collection":[{"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/users\/888"}],"replies":[{"embeddable":true,"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/comments?post=1224"}],"version-history":[{"count":3,"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/posts\/1224\/revisions"}],"predecessor-version":[{"id":1228,"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/posts\/1224\/revisions\/1228"}],"wp:attachment":[{"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/media?parent=1224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/categories?post=1224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/engage.augsburg.edu\/mannj\/wp-json\/wp\/v2\/tags?post=1224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}