This code enables you to add a image upload field to all Edit Category pages which also includes Edit category pages for child categories.
You can also use this code for any taxonomy type simply by replacing all instances of category with the name of your taxonomy in the upload.php file.
Here’s an example showing a grid of images for each child category of 1 parent. Each image links back to the child category archive page.
The solution also includes a page template which you can use to display the image for each category or child category.
Demo Video – 2m 32s
Shows you how the code adds a image upload field to the edit category page which enables you to add a image for each category or child category and then display each category title and image on the front end using a template.
Code Installation
There’s 4 steps:
Step 1 : Upload the page-terms.php & upload.php files to your child themes root directory.
Step 2 : Add the following line of PHP code to the end of your child themes root directoy:
require_once( get_stylesheet_directory() . '/upload.php' );
Step 3 : Select the Category Images template from the Templates drop down menu in the Page Attributes box on any Edit Page screen.
Step 4 : Add the CSS from the style.css file to the end of your child themes style.css file
You can then upload a image to each Edit Category page.
Here’s the files for logged in members:
Was This Tutorial Helpful?