[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

[bw_pdf] – list attached PDF’s with/without icons

Use the [bw_pdf] shortcode to list PDF files which have been attached to your post/page/CPT. I’ve attached two .pdf files to this shortcode example. Below you can see the result of performing the upload and inserting them into the post. the-oik-limerick bw_pdf another oik plugin shortcode And here you can see the result of uploading but NOT inserting them into the post and using the [bw_pdf] shortcode instead.

bw_pdf another oik plugin shortcodebw_pdf another oik plugin shortcode

the oik limerick ( attached to bw_pdf without icons)the oik limerick ( attached to bw_pdf without icons)

The results are similar (spot the differences yourself) but the code for the shortcode is so much shorter…

[bw_pdf]
 
rather than

<div class="bw_attachment">
<p><a class="bw_attachment" id="link-1511" href="http://www.oik-plugins.com/wp-content/uploads/2012/02/bw_pdf-another-oik-plugin-shortcode.pdf" title="bw_pdf another oik plugin shortcode">bw_pdf another oik plugin shortcode</a><span class="title">bw_pdf another oik plugin shortcode</span></p>
<div class="cleared"></div>
<div class="bw_attachment">
<p><a class="bw_attachment" id="link-1510" href="http://www.oik-plugins.com/wp-content/uploads/2012/02/the-oik-limerick.pdf" title="the-oik-limerick">the-oik-limerick</a><span class="title">the-oik-limerick</span></p>
<div class="cleared"></div>
</div>
 

Notes

If you don’t want the PDF icons you need to override the CSS using custom CSS

div.noicon a[href*='.pdf'] { background-image: none; padding-left: 3px; }
 
then add the class name to the shortcode. e.g.

[bw_pdf class="noicon" titles=n]
 
This should give the list without the PDF icon, nor the titles after the links

bw_pdf another oik plugin shortcode

the oik limerick ( attached to bw_pdf without icons)

Notes:

  • The oik limerick was first published as “How to attach a .pdf file using Add media”
  • In this site we generally use custom CSS to turn off the display of titles which are produced by shortcodes such as [bw_pdf] and [bw_images].
    div.bw_attachment span.title {display: none;}
     
    You can achieve a similar result using the titles=n parameter.

Published: February 7, 2012 | Last updated: August 8, 2014

Information

Shortcode: bw_pdf – Display attached PDF files
Letters:

Syntax

Syntax

[bw_pdf
numberposts="5| numeric - number to return"
offset="0| numeric - offset from which to start"
category="| category ID - numeric ID of the post category"
category_name="| category-slug - category slugs (comma separated)"
customcategoryname="| category-slug - custom category slug"
orderby="date| ID| title| parent| rand| menu_order - Sort sequence"
order="DESC| ASC - Sort order."
include="| id1,id2 - IDs to include"
exclude="| id1,id2 - IDs to exclude"
meta_key="| meta key - post metadata key"
meta_value="| meta value - post metadata value"
post_type="attachment| post type - Post type to display"
post_mime_type="application/pdf| - Cannot be overridden"
post_parent="| ID - Parent ID to use if not current post"
post_status="| publish| inherit| pending| draft| auto-draft| future| private| trash| any - Post status"
id="| id1,id2 - IDs of posts to display"
posts_per_page="| numeric| . - Number of posts per page. Use '.' for current value 15"
captions="n| y - Display attachment's Caption and Description"
class="| class names - CSS class names"]

Other examples

  • bw_pdf to display an attachment with a specific ID ( e.g. 5903)
  • Display the PDF files which are attached to a specific post ID
  • How to display the list of PDF files attached to your website
  • List of all PDF attachments ordered by title

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: oikplug@oik-plugins.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.1.1. PHP: 7.4.33. Memory limit: 768M