Uploading featured image to terms of selected taxonomies

Upload featured Image to taxonomies
Without any plugin you can add the thumbnail or featured image to every terms of selected taxonomies. I did following functionality:

  • Creating a user interface at Genesis Theme Settings page.
  • Enable the featured image option for terms of selected taxonomy
  • Adding a new field in Add/Edit terms form
  • Saving the attachment for terms

Step 1:

Creating a UI (user interface) at Dashboard -> Genesis -> Theme Settings page. All taxonomies will be listing there. You will check the checkbox and enable the featured image option for your taxonomies. By default it is disabled for all taxonomies. Copy the following code and put in your functions.php file.

This content is only available to members. You must subscribe the monthly membership plan ($.9.99 USD).

Step 2:

Adding media uploader field in terms add/edit form. Put the following codes in your functions.php file.

This content is only available to members. You must subscribe the monthly membership plan ($.9.99 USD).

Step 3:

Creating a media.uploader.js file and put this file in your child theme’s js folder. It is opening the media uploader popup box and you can upload or add existing image into your term. Copy the full code and put in media.uploader.js file. Note: Don’t change the file name.

This content is only available to members. You must subscribe the monthly membership plan ($.9.99 USD).

Now we need to enqueue the above JS file on term’s add/edit page. Add the following PHP codes in your functions.php file:

This content is only available to members. You must subscribe the monthly membership plan ($.9.99 USD).

Step 4:

Upload a placeholder image in your child theme’s images folder. This placeholder image will show if your term have no thumbnail or featured image.

If you need any help then you can feel free contact me.

Share This Article

Subscribe Membership Plan ($9.99/mo)

  • Get full access to all premium tutorials
  • Get Support for the posted content
  • Request for specific how-to tutorials
  • Cancel the subscription at anytime

Reader Interactions

Leave A Reply

Your email address will not be published. Required fields are marked *