• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Customize the display of Easy Digital Downloads download history

Learn in this tutorial how to customize the way Easy Digital Downloads (EDD) download history is displayed using code.

If you are using the [download_history] shortcode of Easy Digital Downloads to display the download history to the user, you will have noticed that the design is quite simple.

EDD Download History Default Design
EDD Download History Default Design

This austere design may be sufficient for displaying a list of download links, but you may want to display something more visually appealing.

For example, something like this:

EDD download history custom layout
EDD download history custom layout

Interested? Here’s how you can get it:

Steps to customize how Easy Digital Downloads download history is displayed

1. Create a history-downloads.php file

First of all, create a folder called edd_templates in the root of your theme. Then create inside it a file called history-downloads.php with the following code.

To see this and another 847 code snippets of this website, login or subscribe here.

In this case, the structure has the following elements:

  • Featured image (get_the_post_thumbnail ( $download['id'], 'medium' ))
  • Title ($title = $user_download->post_title;)
  • Excerpt ($excerpt = $user_download->post_excerpt;)
  • Author ($author_id = $user_download->post_author;)
  • Button with link to download (or to content if there is no download)

The featured image will be displayed in WordPress medium size which by default is 300 x 300 pixels, but you can also use other sizes from plugins or themes.

If you want to know what are the image sizes of your WordPress installation you can follow the tutorial where I explained it.

It is also intended to show the author/creator with a link to the rest of the content created by the same.

And it will show a “Download” button in the EDD products that have a file or a “View” button if they don’t have one.

This is just an example so you can modify it to your liking.

2. Customize the styles

Once you have created the structure you are interested in, you only need to apply the CSS styles. To do this, add the following lines to the end of the style.css file:

To see this and another 847 code snippets of this website, login or subscribe here.

As with the elements you want to display, the idea is that you customize the design to your liking.

Conclusions

Do you want to customize the way Easy Digital Downloads download history is displayed? Now you know how to do it using code.

If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.

Benefits of being a subscriber. 🙂

CPT Easy Digital Downloads PHP WordPress

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?