[download-attachments]

Description

A shortcode that enables attachments display inside posts content or manual attachments display anywhere in a theme.

Usage

[download-attachments container="div" title="Attachments" style="none" display_icon="0" display_user="1"]

Attributes

  • container – a download attachments container selector, defaults to: “div”
  • container_class – a download attachments container class, defaults to: “download_attachments”
  • container_id – a container id, defaults to: “”
  • style – a style, defaults to: “list”
  • link_before – optional content displayed before download link, defaults to: “”
  • link_after – optional content displayed after download link, defaults to: “”
  • display_user | 0 or 1 – option to display who added an attachment to download, defaults to: plugin settings
  • display_icon | 0 or 1 – option to display an attachment icon, defaults to: plugin settings
  • display_count | 0 or 1 – option to display downloads count, defaults to: plugin settings
  • display_size | 0 or 1 – option to display an attachment file size, defaults to: plugin settings
  • display_date | 0 or 1 – option to display the date of adding an attachment to download, defaults to: plugin settings
  • display_caption | 0 or 1 – option to display an attachment caption, defaults to: plugin settings
  • display_description | 0 or 1 – option to display an attachment description, defaults to: plugin settings
  • display_empty | 0 or 1 – whether to display Download Attachments box if there are no attachents added, defaults to: plugin settings
  • display_option_none  – text for no attachments available, defaults to: “No attachments to download”
  • exclude – a comma separated list of attachment IDs to exlude from display, defaults to: “”
  • include – a comma separated list of attachment IDs to include in display, defaults to: “”
  • title – text for download attachment box, defaults to: “Download Attachments”
  • orderby – attachments sorting method, defaults to: “menu_order” – which means a manual order, as set in Download Attachments metabox
  • order – attachments sort order, defaults to: “asc”

Leave a Reply

Please, do not use this form for technical support. To get support for our plugins, use the support forum.

Your email address will not be published. Required fields are marked *

8 comments on "[download-attachments]"

  1. Good morning, I entered the short code inside the table but all the attachments are displayed loaded so far from the plugin and it is impossible to delete them because the editor does not display.

    this is the shortcode:
    [download-attachments container=”div” title=”Allegati” style=”none” display_icon=”1″ display_size=”1″  display_user=”0″]
    I try to set Admin options but I had no results.

    Please help me☻
    An option might be to tell me the code where the command for sorting the files is contained in order to force the insertion of the only attachments of the article.
    Thanks

    • This is not a place for this. Please create a support thread, enter issue description there and provide a link to your site.

  2. Where exactly should i put this shortcode, so that i don’t break the site?

    • Anywhere you want, but keep it in the loop.

  3. Thanks….So good
    You can custom query
    $attachments = da_get_download_attachments(
    $post->ID,
    apply_filters(
    ‘da_display_attachments_args’,
    array(‘include’ => ”,’exclude’ => true,’orderby’ => ”,’order’ => ”)
    )
    );

    echo ”;
    print_r($attachments);
    echo ”;

  4. I’m looking for a way to display the site-wide top downloads, using a shortcode as shown below. However, it only shows the downloads on the actual page were they were added – as soon as you place the shortcode on another page, no downloads are shown.

    [download-attachments container=”div” title=”” style=”list” display_icon=”0″ display_user=”0″ display_size=”0″ display_description=”0″ display_caption=”0″ orderby=”attachment_downloads” order=”desc” exclude=””]

    Is this “working as designed” or amy I missing someting?

  5. How’d I use a php function instead of the shortecode?

    • Pedro, this shortcode is just a wrapper for da_display_download_attachments() function you may find in includes/functions.php

      It uses the same set of parameters.