1. Home
  2. Documentation
  3. Posts Table Pro
  4. FAQ
  5. Can I add links, downloads, icons or buttons in Posts Table Pro?

Can I add links, downloads, icons or buttons in Posts Table Pro?

You can use Posts Table Pro to display extra links, buttons or icons in the table. These links, buttons and icons can link to any URL, for example another page on your site, an external URL or a link to download a file (such as a PDF) in the Media Library.

You can add these links to any text fields that you’re displaying as columns in the table, such as the content or excerpt columns, or a custom field. For example, our WordPress document library demo includes a custom field column which contains links, downloads, icons and buttons so you can see them all in action.

You may also be interested in our tutorial: How to Create a WordPress Document Library.

How to add buttons, icons etc. to your tables

  1. Decide which field you will use to display the links/buttons/icons. If you don’t want to use the content or excerpt fields then you can use a custom field (we recommend using the free Advanced Custom Fields plugin for this).
  2. Use this field to add a clickable link for each item that you will be displaying in the table. Some tips:
    • Either add the link using the standard WordPress visual editor, or switch to ‘Text’ view and add the full HTML code to create a link. (e.g. <a href="https://barn2.co.uk">DOWNLOAD</a>)
    • If you want to create a button or icon, add the HTML code or shortcode for your button/icon. This will depend on your theme – for example, your theme may provide a shortcode for buttons or icons. (If you don’t know how to do this, ask your theme developer. If your theme doesn’t have the styles you need, you can use a plugin such as Shortcodes Ultimate to create buttons, or Better Font Awesome to create icons.).
  3. Use Posts Table Pro to create a table with a column for the field containing the links. See the example below, or our article on creating tables with Posts Table Pro.
  4. You will also need to go to the Posts Table Pro settings page (Settings -> Posts Table Pro) and tick the ‘Shortcodes’ option. This tells Posts Table Pro to display the links as clickable links instead of plain text.

Screenshots

WordPress document library custom fields plugin

Example of custom fields for a document post which can be displayed in the table

WordPress document library download buttons

Example of a WordPress document library with buttons, links and icons in a ‘LINK’ custom field

Example shortcode

The following Posts Table Pro shortcode will create a simple table with columns for title and download link. It assumes that you are using a post type called ‘documents’ and your custom field name is ‘download’:

[posts_table post_type="documents" columns="title,cf:download" shortcodes="true"]

Was this article helpful?

Related Articles