Title: COP PDF Attachment Menu
Author: Trevor Green
Published: <strong>14. august, 2011</strong>
Last modified: 17. november, 2014

---

Søg plugins

![](https://ps.w.org/cop-pdf-attachment-menu/assets/banner-772x250.jpg?rev=696310)

Dette plugin **er ikke blevet testet med de seneste 3 større udgivelser af WordPress**.
Det vedligeholdes eller understøttes muligvis ikke længere og kan have kompatibilitetsproblemer,
når det bruges med nyere versioner af WordPress.

![](https://s.w.org/plugins/geopattern-icon/cop-pdf-attachment-menu_f3eb8c.svg)

# COP PDF Attachment Menu

 Af [Trevor Green](https://profiles.wordpress.org/trevogre/)

[Download](https://downloads.wordpress.org/plugin/cop-pdf-attachment-menu.zip)

 * [Detaljer](https://da.wordpress.org/plugins/cop-pdf-attachment-menu/#description)
 * [Vurderinger](https://da.wordpress.org/plugins/cop-pdf-attachment-menu/#reviews)
 *  [Installation](https://da.wordpress.org/plugins/cop-pdf-attachment-menu/#installation)
 * [Udvikling](https://da.wordpress.org/plugins/cop-pdf-attachment-menu/#developers)

 [Support](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/)

## Beskrivelse

Adds a shortcode [pdfmenu] and a widget that defaults to displaying an unordered
list of all pdf’s attached to the current page or post.

There are options for both altering the query to return a different set of attachments
and for formatting the output.

This plugin should always default to:

    ```
    <ul class="cop_pdfmenu">
        <li class="attachment/pdf"><a href="(direct uri to attachment)" target="_blank" title="(attachment title)">(attachment title)</a>
    </ul>
    ```

The attachments will be ordered by date in the ascending order by default.

#### Shortcode Options include:

 * Change list types ol, li, div (nested divs).
    - [pdfmenu list_type=”ul”]
    - [pdfmenu list_type=”ol”]
    - [pdfmenu list_type=”div”]
 * Set a different class on the container.
    - [pdfmenu class=”differentclass”]
 * Set a different target.
    - [pdfmenu target=”differenttarget”]
 * Get a list of pdfs from a different parent.
    - [pdfmenu post_parent=”1″]
 * Change the number of pdfs to return. (currently no paging).
    - [pdfmenu numberposts=”-1″] (returns all attachments)
 * Change the post_mime_type to query for a different type or multiple types.
    - [pdfmenu post_mime_type=”application/zip”]
 * Force download of the attachments
    - [pdfmenu dowload=”all”] (force download of all listed attachments)
    - [pdfmenu dowload=”application/pdf”] (force download of a single mime type)

Widget Options include all of the shortcode options and add some selectors for altering
the query and output.

## Installation

Extract the zip file and just drop the contents in the wp-content/plugins/ directory
of your WordPress installation and then activate the Plugin from Plugins page.

## FAQ

**How can I style the mime type classes that are now output?**

You will now see `<li class="application/pdf">` (or your selected mime type) in 
the code. But you can’t type the / in your stylesheet!

In order to refer to this style you need to change the / to \2f in your classname.

So it looks like

    ```
    .application\2fpdf { 

    }
    ```

That solution reduces that amount of code required to output the class and only 
sligthly increases the complexity of styling. It is the least code approach rather
than the most user-friendly approach. Which I think is better in this case.

More Questions Please.

[Questions / Donations](http://www.agreenweb.com/wordpress/cop-pdf-attachment-menu/cop-pdf-attachment-menu-donations/)

## Anmeldelser

![](https://secure.gravatar.com/avatar/ce3d56a07745303bf98d216bf3459830e76a134b88ebb1b6df18c249b75646e2?
s=60&d=retro&r=g)

### 󠀁[Works Great](https://wordpress.org/support/topic/works-great-2406/)󠁿

 [Jessica J.](https://profiles.wordpress.org/jessicajjohnston/) 3. september, 2016

Great plugin, works just as described. Allowed me to do a bit of extra custom coding
to display PDF files on a client website I manage. Looks great, and best of all,
it works flawlessly still, even after 2+ years it's been installed on the website.
Thanks for sharing!

 [ Læs alle 2 anmeldelser ](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/)

## Bidragsydere & udviklere

“COP PDF Attachment Menu” er open source-software. Følgende personer har bidraget
til dette plugin.

Bidragsydere

 *   [ Trevor Green ](https://profiles.wordpress.org/trevogre/)

[Oversæt “COP PDF Attachment Menu” til dit eget sprog.](https://translate.wordpress.org/projects/wp-plugins/cop-pdf-attachment-menu)

### Interesseret i udvikling?

[Gennemse koden](https://plugins.trac.wordpress.org/browser/cop-pdf-attachment-menu/),
tjek [SVN repository](https://plugins.svn.wordpress.org/cop-pdf-attachment-menu/),
eller abonner på [udviklerloggen](https://plugins.trac.wordpress.org/log/cop-pdf-attachment-menu/)
via [RSS](https://plugins.trac.wordpress.org/log/cop-pdf-attachment-menu/?limit=100&mode=stop_on_copy&format=rss).

## Ændringslog

#### 0.1.1

 * First WordPress 4.0 testing
 * Added the first version of paging to the shortcode and widget functionality so
   that you can set numberofposts and your attatchments will show page navigation
   within the page.
    - This should fix but not necessarily modify the previous default behavior as
      it appears that the previous version was output the page numbers but they 
      were not functioning.
    - Paging only works appropriately with a single instance of paging per page.
      Multiple instances will all navigate between pages together.
 * Added the [attachments], and [attachmentmenu] shortcode. I haven’t checked to
   see if [attachments] creates conflicts with other plugins. This has the same 
   functions but it defaults to listing all mime types rather than just pdf files.
   Use with caution, this may be renamed if I discover I’m overlapping with another
   plugin. [attachmentmenu] is more in line with future plans I have and will should
   be safer.
 * Cleaned up extract code from the shortcode.
 * Added a span of class=”sep” to the | in the paging so that it can be styled but
   still have a default appearance that is functional.

#### 0.1.0

 * Added download=”(mime type)” and download=”all” which converts links to forced
   download links. Allows other types (all types not tested).
 * Widget also allows you to set the mime type to force downloads
 * Thanks to [sallydeford](https://wordpress.org/support/profile/sallydeford) for
   suggesting forced download links as an option.

#### 0.0.9.8

 * Just updating things for the plugin page.

#### 0.0.9.7

 * IMPORTANT Change. The widget (not the shortcode) was showing all pdf files with
   the default settings instead of just the attachments to the current post. Should
   be working now.

#### 0.0.9.6

 * Fixed error with shortcode showing all types by default
 * Thanks to [sallydeford](https://wordpress.org/support/profile/sallydeford) for
   pointing out the issue.

#### 0.0.9.5

 * Added options to display captions and descriptions.
 * style captions with .the_caption
 * style description with .the_description

#### 0.0.9.4

 * Minor Fixes to new features. (Was defaulting in the widget to “all types”
 * Added localization functions.

#### 0.0.9.3

 * Added [pdfmenu all_types=’true’] to the shortcode.
 * Added and all types checkbox to the widget.
 * All items have thier mime type as a class (ex. class=”application/pdf”).

#### 0.0.9.2

 * Adding the mime type as a class to each list item ( ex. class=”application/pdf”).
   Would have added it to the container but I wanted to be able to later add the
   output and styling of attachments of multiple mime types in a single list.
 * Changed basic ownership details of the plugin to point to my current site [www.agreenweb.com](http://www.agreenweb.com/).

#### 0.0.8

 * Minor changes to the widget editor

#### 0.0.7

 * Added ordering options to the widget settings.

#### 0.0.6

#### Shortcode

Added orderby and order to the shortcode options for reordering.

#### defaults are:

 * orderby = “date”
 * order = “ASC”

#### In Progress

 * Started adding paging.

 * Add offset=”x” or paged=”x” with a numberposts=”(number)” that is not zero to
   the shortcode.
 * In order to get another set of links.
 * There is not yet any navigation.

#### Widget

Added an option to add a title.

Did some debugging.

#### 0.0.5

Added a check requiring php version 5.2.1 on install.
 Moved more code into classes.

#### 0.0.4

Added custom widget class. No change to function.

#### 0.0.3

Improved the widget options.

#### 0.0.2

Added basic widget that functions the same as the shortcode.

#### 0.0.1

Initial Version

## Meta

 *  Version **0.1.1**
 *  Senest opdateret **12 år siden**
 *  Aktive installationer **40+**
 *  WordPress-version ** 3.2.1 eller højere **
 *  Testet op til **4.0.38**
 *  Sprog
 * [English (US)](https://wordpress.org/plugins/cop-pdf-attachment-menu/)
 * Tags
 * [attachments](https://da.wordpress.org/plugins/tags/attachments/)[list](https://da.wordpress.org/plugins/tags/list/)
   [menu](https://da.wordpress.org/plugins/tags/menu/)[pdf](https://da.wordpress.org/plugins/tags/pdf/)
   [widget](https://da.wordpress.org/plugins/tags/widget/)
 *  [Avanceret visning](https://da.wordpress.org/plugins/cop-pdf-attachment-menu/advanced/)

## Bedømmelser

 5 ud af 5 stjerner.

 *  [  2 5-stjernet anmeldelser     ](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/?filter=5)
 *  [  0 4-stjernet anmeldelser     ](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/?filter=4)
 *  [  0 3-stjernet anmeldelser     ](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/?filter=3)
 *  [  0 2-stjernet anmeldelser     ](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/?filter=2)
 *  [  0 1-stjernet anmeldelser     ](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/?filter=1)

[Din anmeldelse](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/#new-post)

[Se alle anmeldelser](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/reviews/)

## Bidragsydere

 *   [ Trevor Green ](https://profiles.wordpress.org/trevogre/)

## Support

Har du noget at sige? Har du brug for hjælp?

 [Vis supportforum](https://wordpress.org/support/plugin/cop-pdf-attachment-menu/)

## Donér

Vil du gerne støtte udviklingen af dette plugin?

 [ Donér til dette plugin ](http://www.agreenweb.com/wordpress/cop-pdf-attachment-menu/cop-pdf-attachment-menu-donations/)