{"id":1764724,"date":"2022-01-24T13:50:14","date_gmt":"2022-01-24T19:50:14","guid":{"rendered":"https:\/\/edd-site.lndo.site\/docs\/downloads-shortcode\/"},"modified":"2022-07-12T16:31:29","modified_gmt":"2022-07-12T21:31:29","slug":"downloads-shortcode","status":"publish","type":"edd_doc","link":"https:\/\/easydigitaldownloads.com\/docs\/downloads-shortcode\/","title":{"rendered":"Downloads Shortcode"},"content":{"rendered":"\n<p>You can easily output a list or grid of downloadable products using the [downloads] shortcode. This shortcode accepts a variety of parameters that allow you to specify what downloads are displayed, and how they are displayed.<\/p>\n\n\n\n<p>To show downloads with the default configuration, use this:<br><strong>[downloads]<\/strong><\/p>\n\n\n\n<p>This will output the downloads in a three column grid with thumbnails (if present), a 30 word excerpt, and a purchase button that says &#8220;Add to Cart&#8221;.<\/p>\n\n\n\n<p>If you wish to modify this output, here is a list of the parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>category<\/li><li>exclude_category<\/li><li>tags<\/li><li>exclude_tags<\/li><li>relation<\/li><li>number<\/li><li>price<\/li><li>excerpt<\/li><li>full_content<\/li><li>buy_button<\/li><li>columns<\/li><li>thumbnails<\/li><li>orderby<\/li><li>order<\/li><li>ids<\/li><li>pagination=true\/false<\/li><\/ul>\n\n\n\n<p>Both the<em> <\/em><em>category<\/em>\u00a0and\u00a0<em>tags<\/em>\u00a0parameters accept a comma separated list of IDs. For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[downloads category=\"7,15\" tags=\"16,17\"]\n<\/pre>\n\n\n\n<p>You can find a category&#8217;s ID by going to <em>Dashboard \u2192 Downloads \u2192<\/em><em> Categories<\/em>, then click &#8220;edit&#8221; below the category in question. On the page that loads, look at the URL in the address bar and find &#8220;tag_ID=&#8221;. The number after it is the category ID.<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/easydigitaldownloads.com\/wp-content\/uploads\/2022\/07\/6184cc8f8b544.jpg\">Use the same process to find a tag ID by going to <em style=\"background-color: initial;\">Dashboard \u2192 Downloads \u2192<\/em><em style=\"background-color: initial;\"> Tags.<\/em><\/p>\n\n\n\n<p>The  <em>exclude_category<\/em> and <em>exclude_tags<\/em> parameters are used to prevent downloads with specific categories or tags from being displayed. Use a comma separated list of IDs for each.<\/p>\n\n\n\n<p>The<em> order<\/em>\u00a0parameter accepts either\u00a0<em>&#8220;DESC&#8221;<\/em>\u00a0or\u00a0<em>&#8220;ASC&#8221;<\/em>.<\/p>\n\n\n\n<p>The\u00a0 <em>orderby<\/em>\u00a0parameter accepts the following options:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>price<\/li><li>id<\/li><li>random<\/li><li>post_date <em>(default)<\/em><\/li><li>title<\/li><\/ul>\n\n\n\n<p>If <em>orderby<\/em> is set to <em>random<\/em>, pagination will be disabled to prevent subsequent pages from showing already-displayed products.<\/p>\n\n\n\n<p>The<em> number<\/em>\u00a0and\u00a0<em>columns<\/em>\u00a0parameters accept a numerical value. Specify the maximum number of downloads you want to outputted by the shortcode, as well as the number of columns. For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[downloads number=\"15\" columns=\"3\"]\n<\/pre>\n\n\n\n<p>The<em> <\/em><em>relation<\/em>\u00a0option is for specifying whether the downloads displayed have to be in ALL the categories\/tags provided, or just in at least one. Use &#8220;AND&#8221; for showing downloads that are filed in every category\/tag (very specific), and use &#8220;OR&#8221; for showing downloads filed in any of the given categories\/tags. Leave both of these blank to show all downloads.<\/p>\n\n\n\n<p><em>Price, excerpt, full_content<\/em>,\u00a0and\u00a0<em>buy_button<\/em>\u00a0accept &#8220;yes&#8221; or &#8220;no&#8221;.<\/p>\n\n\n\n<p>The<em> thumbnails<\/em>\u00a0parameter requires &#8220;true&#8221; or &#8220;false&#8221;.<\/p>\n\n\n\n<p>The<em> ids<\/em>\u00a0parameter accepts specific download IDs. You can specify multiple download IDs using comma separated values. For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[downloads ids=\"3,4,17\"]\n<\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[downloads category=\"14,15\" number=\"10\" columns=\"2\"]\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Customizing the output programmatically in your child theme:<\/h4>\n\n\n\n<p>It is possible to customize the content that is output by the [downloads] shortcode by moving the template files into your child theme&#8217;s folder. Specifically, you&#8217;ll likely want to move the template file called &#8220;shortcode-download.php&#8221;, or one of its child files into your child theme&#8217;s folder. To do this, follow the guide in <a href=\"https:\/\/easydigitaldownloads.com\/docs\/moving-edd-templates-to-your-theme\/\">this doc<\/a>. Note that doing this requires advanced WordPress theme coding knowledge. If you require assistance with this, we have a <a href=\"https:\/\/easydigitaldownloads.com\/customize-easy-digital-downloads\/\">consultants page<\/a> with professionals available for hire for custom code-related jobs like this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can easily output a list or grid of downloadable products using the [downloads] shortcode. This shortcode accepts a variety of parameters that allow you to specify what downloads are displayed, and how they are displayed. To show downloads with the default configuration, use this:[downloads] This will output the downloads in a three column grid [&hellip;]<\/p>\n","protected":false},"template":"","edd_doc_category":[],"class_list":["post-1764724","edd_doc","type-edd_doc","status-publish","hentry"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/easydigitaldownloads.com\/wp-json\/wp\/v2\/docs\/1764724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easydigitaldownloads.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/easydigitaldownloads.com\/wp-json\/wp\/v2\/types\/edd_doc"}],"version-history":[{"count":0,"href":"https:\/\/easydigitaldownloads.com\/wp-json\/wp\/v2\/docs\/1764724\/revisions"}],"wp:attachment":[{"href":"https:\/\/easydigitaldownloads.com\/wp-json\/wp\/v2\/media?parent=1764724"}],"wp:term":[{"taxonomy":"edd_doc_category","embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/wp-json\/wp\/v2\/edd_doc_category?post=1764724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}