  {"id":1045,"date":"2019-11-14T16:05:46","date_gmt":"2019-11-14T16:05:46","guid":{"rendered":"https:\/\/www.uri.edu\/styleguide\/?page_id=1045"},"modified":"2024-07-08T15:00:09","modified_gmt":"2024-07-08T15:00:09","slug":"display-posts","status":"publish","type":"page","link":"https:\/\/www.uri.edu\/wordpress\/tools\/display-posts\/","title":{"rendered":"Display Posts"},"content":{"rendered":"\n<p class=\"type-intro\">The Display Posts tool makes it easy to render dynamic lists of posts that meet specific criteria.<\/p>\n\n\n\n<p>The Display Posts tool is a third party plugin with <a href=\"https:\/\/displayposts.com\/docs\/\">extensive documentation<\/a> on its parameters and usage. However, the tool has a few custom capabilities that help integrate it into the theme and components.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Adding Display Posts<\/h2>\n\n\n\n<p>Display Posts can be implemented with the shortcode&nbsp;<code class=\"shortcode\">display-posts<\/code>.<\/p>\n\n\n\n<p class=\"code shortcode\">[display-posts category=\"News\"]<\/p>\n\n\n\n<p>Display Posts can show results as <a href=\"https:\/\/www.uri.edu\/wordpress\/components\/cards\/\">cards<\/a>, <a href=\"https:\/\/www.uri.edu\/wordpress\/components\/heroes\/\">heroes<\/a>, or <a href=\"https:\/\/www.uri.edu\/wordpress\/components\/panels\/\">panels<\/a>:<\/p>\n\n\n\n<p class=\"code shortcode\">[display-posts category=\"News\" component=\"card\" cl-button=\"Read Now\"]<\/p>\n\n\n\n<p>Note that, in this example, the native card attribute <code class=\"attribute\">button<\/code> is also set, with the prefix <code class=\"attribute\">cl-<\/code>. Any attributes of the chosen results component can be set this way, overriding any default or dynamic values the Display Posts plugin might set for them.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Custom Attributes<\/h2>\n\n\n\n<div class=\"wp-block-columns shortcode-attributes is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<h3 class=\"wp-block-heading\">component<\/h3>\n\n\n\n<p>(string) (optional) (values: <code class=\"string\">card<\/code>, <code class=\"string\">hero<\/code>, <code class=\"string\">panel<\/code>)<\/p>\n\n\n\n<p>Set a component to use for rendering results.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<h3 class=\"wp-block-heading\">cl-<em>[attr]<\/em><\/h3>\n\n\n\n<p>(string) (optional)<\/p>\n\n\n\n<p>Set an applicable attribute to be passed to the component shortcode set in <strong>component<\/strong>. Values set here will override any similar data retrieved by Display Posts.<\/p>\n\n\n\n<p>(examples: <code class=\"string\">cl-format=\"fullwidth\"<\/code> or <code class=\"string\">cl-button=\"My Button Text\"<\/code>)<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Display Posts tool makes it easy to render dynamic lists of posts that meet specific criteria. The Display Posts tool is a third party plugin with extensive documentation on its parameters and usage. However, the tool has a few custom capabilities that help integrate it into the theme and components. Adding Display Posts Display [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1027,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-1045","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/pages\/1045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/comments?post=1045"}],"version-history":[{"count":27,"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/pages\/1045\/revisions"}],"predecessor-version":[{"id":2553,"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/pages\/1045\/revisions\/2553"}],"up":[{"embeddable":true,"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/pages\/1027"}],"wp:attachment":[{"href":"https:\/\/www.uri.edu\/wordpress\/wp-json\/wp\/v2\/media?parent=1045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}