This video goes over how to change the “Downloads” label and slug to “Themes” throughout the plugin and theme. The labels are what you see in the WordPress dashboard and the slug is the URL.
This will allow us to navigate to http://yoursite.com/themes instead of http://yoursite.com/downloads which is also nice!
Steps from the Video
- Go to the Easy Digital Downloads documentation and grab the function that changes the post type labels. You can find that code here.
- Create a new file called
/inc/directory and paste in the code.
- Replace all instances of “Products” to “Themes” and “Product” to “Theme”
- Replace the text domains from “your-domain” to match your theme text domain
- Include the new
edd.phpfile in our main
functions.phpfile with the following code:PHP1234/*** Easy Digital Downloads*/require get_template_directory() . '/inc/edd.php';
- Refresh the WordPress Dashboard and notice the new labels!
- To change the URL slug go grab the EDD constant here
- Put this code in our
edd.phpfile and change ‘my-downloads-slug’ to ‘themes’
- From the WordPress Dashboard go to Settings -> Permalinks and click Save
- Reload an individual theme on the front-end and notice your new slug!