Images for categories, tags, and other taxonomy terms
Images for categories, tags, and other taxonomy terms
WP Term Images allows users to assign images to any visible category, tag, or taxonomy term using the media library, providing a customized look for their taxonomies.
Not since WordPress 4.4.
Install the WP Term Meta plugin if you’re on an earlier version.
No. There are no new database tables with this plugin.
No. All of WordPress’s core database tables remain untouched.
With WordPress’s get_term_meta()
function
// image id is stored as term meta $image_id = get_term_meta( 7, 'image', true ); // image data stored in array, second argument is which image size to retrieve $image_data = wp_get_attachment_image_src( $image_id, 'full' ); // image url is the first item in the array (aka 0) $image = $image_data[0]; if ( ! empty( $image ) ) { echo '<img src="' . esc_url( $image ) . '" />'; }
http://github.com/stuttter/wp-term-images/