I want to display custom static content, essentially an image and a small description, at the top of each category page (different for each category and sub category), displayed above a list of titles of the category posts with excerpts.
Is there an automated solution/plugin available for this? I need an automated way to insert text/image too because I want to pass this to my content writer and he will take care of the new categories. A rich text editor where I can insert image and text, which will be assigned to a category and can be shown on top of the category page.
Simply call the
category_description()
– this displays the description that you can enter for each category that you add in the admin UI under “category” (or post tag or each other custom taxonomy).You can as well use the underlying API function:
Here’s raw code for the DIY people.
With these you can actually do more, such as adding an ordering field or whatever your heart desires.
In the action call you can change:
add_action('category_edit_form_fields','extra_category_fields');
to your specifictaxonomy by changing category to your taxonomy name as so:
Finally to get your meta content you can use this:
You can use the following plugin: http://wordpress.org/extend/plugins/categorytinymce/screenshots/
Then, in your template files just insert the the_description() template tag.
I would use a plugin like ACF to create fields for the image and description of a category since a non technical person will be using it. Then you can query the taxonomy’s fields using the information found here. You can even use
the_description()
and just one custom field for uploading the image.