Support » Plugin: EG-Attachments » Tip: Use Pagination with EG-Attachments to Display Multiple Sorts

  • I realized I could show two sorts on one page by simply duplicating the code, adding some manual links, and changing the sort reference in the EG-Attachments shortcode.

    In this example, I am first sorting by caption (in which I am putting the publication date year for all documents for this site), and then by title.

    You can see the two references from my page separated by the built-in WordPress “nextpage” reference.

    <p style="text-align: right;">Sort by Year | <a href="">Sort by Title</a></p>
    <h2>Sorted by Year</h2>
    [attachments id="11" orderby="caption ASC" size=custom label=doctitle titletag="" tags="electronic-device-papers"]
    <p style="text-align: right;"><a href="">Sort by Year</a> | Sort by Title</p>
    <h2>Sorted by Title</h2>
    [attachments id="11" orderby="title ASC" size=custom label=doctitle titletag="" tags="electronic-device-papers"]

    * Using the Breadcrumb NavXT plugin, I deselected the setting to remove “Page X” from the breadcrumb.

    * I manually added the links to each page, only putting the link to the other sort paged page on the current paged page.

    Using the EG-Attachments plugin in this way has made me wish for the following features:

    • Provide ability for user to add attachment custom fields, which can be sorted by in the EG-Attachments shortcode, and which also appear in the Media editor, and which you can sort by and choose in the Media Library page.
    • Provide ability to “Show all Tags” in the Media Library. Right now, you can only “Sort by Date,” which uses the upload date, which is not useful if you want the date to correspond to the Publication Date of your documents.
    • Provide ability to edit the date of the attachment to something other than the upload date.

    I relish this plug-in. It uses the existing WordPress functionality, so with the right Description (and the Search Everything or other search functionality), you can set up your site so that users can get attachments in the WP Search Results.


  • The topic ‘Tip: Use Pagination with EG-Attachments to Display Multiple Sorts’ is closed to new replies.