Categories
Plugins WordPress

Rich Text Tag, Category, and Taxonomy Descriptions for WordPress

Rich Text Tags Plugin on WordPress.org

Taxonomies, baby!The Rich Text Tags plugin allows you to use the WYSIWYG TinyMCE text editor (the WordPress default editor) while editing Categories, Tags, and taxonomies (custom categorization created by the Yoast Simple Taxonomies plugin).

Adding Category & Tag descriptions

There’s plenty of information online on how to add category descriptions and tag descriptions to your theme. WordPress has built-in functionality for those:

How to add the taxonomy title & descriptions to your theme

Once you have the cool new rich text editor, you’ll feel pretty silly if you don’t put that great content in your theme.  So here’s what to do:  add the following snippet of code into your archive.php file.

<?php
if(isset($wp_taxonomies)) {
	// This is getting the friendly version of a taxonomy
	// - not the hyphenated get_yoast_term_title()
	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
	if($term) {
		echo '<h2 class="pagetitle">'.$term->name.'</h2>';
	}
	// If you have a taxonomy description, let'er rip!
	if(function_exists('get_yoast_term_description') && get_yoast_term_description()) {
		echo wptexturize(get_yoast_term_description());
	}
}
?>

Using this code, you can now have custom content on your taxonomy pages, like this one for Andersen Windows.

SEO Benefits of this plugin

Besides the obvious benefits of giving users more information on your archive pages, there are intrinsic SEO benefits to having tag, category, and taxonomy descriptions.

When you have tags and categories where posts overlap, it’s a good idea to try to create as much unique content on each page as possible, so that each page gets indexed by Google. Having custom content for each page will do that.

Help me help you!

Please leave any issues you have with the plugin in the comments below. I like to squash code bugs!

Known Plugin Incompatibilities

This plugin does not work with these plugins:

98 replies on “Rich Text Tag, Category, and Taxonomy Descriptions for WordPress”

Zack- Very cool plugin. By chance I was searching Google for a plugin that could do this and stumbled upon yours. Nice!

Any chance you can incorporate the image uploader into the editor? If that’s possible, I’d definitely use that feature!

Dave

Hi David – I wanted to do that in the first version, but I didn’t have the time. This feature will definitely be in future versions…though I can’t say when.

Which archive.php file do I put the snippet in? This is what I’ve got:

/public_html/members/wp-content/themes/twentythirteen/archive.php

/public_html/members/wp-content/themes/twentyfifteen/archive.php

/public_html/members/wp-content/themes/twentyfourteen/archive.php

/public_html/members/wp-content/themes/twentyfourteen/css/content-archive.php

/public_html/members/wp-content/themes/twentytwelve/archive.php

/public_html/members/wp-content/themes/twentytwelve/languages/sidebar-archive.php

/public_html/wp-content/themes/twentythirteen/archive.php

/public_html/wp-content/themes/twentyfifteen/archive.php

/public_html/wp-content/themes/twentyfourteen/archive.php

/public_html/wp-content/themes/twentyfourteen/sidebar-archive.php

/public_html/wp-content/themes/twentytwelve/archive.php

/public_html/wp-content/themes/twentytwelve/sidebar-archive.php

/public_html/wp-content/themes/blueberry/archive.php

/public_html/wp-content/themes/blueberry/content-archive.php

/public_html/newfiles/wp-content/themes/twentythirteen/archive.php

/public_html/newfiles/wp-content/themes/twentyfourteen/archive.php

/public_html/newfiles/wp-content/themes/twentytwelve/archive.php

/public_html/newfiles/wp-content/themes/blueberry/archive.php

/public_html/newfiles/wp-content/themes/blueberry/sidebar-archive.php

/public_html/newfiles/old_wp-content/backup-1408726189-themes/twentythirteen/archive.php

/public_html/newfiles/old_wp-content/backup-1408726189-themes/twentyfourteen/archive.php

/public_html/newfiles/old_wp-content/backup-1408726189-themes/twentytwelve/archive.php

/public_html/newfiles/old_wp-content/backup-1408726189-themes/blueberry/archive.php

/public_html/newfiles/old_wp-content/themes/twentythirteen/archive.php

/public_html/newfiles/old_wp-content/themes/twentyfourteen/archive.php

/public_html/newfiles/old_wp-content/themes/twentytwelve/archive.php

Help! I am using Thesis with open hook and when I enter the code you give to to my archives.php page to allow my category descriptions to appear on my site like the Anderson Windows example it doesn’t work.

Any idea what I could be doing wrong?

Hi Damiano, that should have been taking care of automatically when using the plugin…but you can always try adding the same code again to your functions.php file:

remove_filter( 'pre_term_description', 'wp_filter_kses' );

Hi,
adding that string doesn’t work, at least for <li> and <img> image… I also upgraded to WordPress 2.9.1. If I’ll find something useful, I’ll posti it here.
Bye

To allow images you need to add this to the functions file
<code>remove_filter( ‘term_description’, ‘wp_kses_data’ );
remove_filter( ‘pre_term_description’, ‘wp_filter_kses’ ); /*added to allow tag images and html*/ </code> I use it and it works on 2.9.2

Hi,
Did you already find a solution for the problem with the <li> and <img> tags? I’ve used allot of lists in my tag descriptions and WP strips them all.. :S
Bye,
Sjoerd

Very cool plugin. I got it working partially, but I couldn’t separate the text into paragraphs. Well, I could in the editor, but it wouldn’t show on the main site. I added the function code you provided as well, but no dice. Also, every time I added pasted text (I was working on text in a text editor), it would oddly add it twice. Any thoughts as to what’s causing this?
Thanks.

This plugin isn’t stripping out the IMG tags – you can save and then view source to confirm that your image paths are still there. The problem is that as of WP 2.9, the WP category_description function strips out IMG and other tags.
The fix is here, and it’s simple:
http://wordpress.org/support/topic/343659?replies=7
Nutshell: Just use this in your archive.php template instead:
$category = get_the_category();
echo $category[0]->category_description;

Thank you for the informative post and great plugin!

I was wondering if you know how to echo images, links, and other html with the tag_description(); ? I use the Rich Text Tag plugin so that I can easily add in images and links, but when I make the echo call, it strips these out.

I am using WP 3.0 and heard that 2.9 was a party pooper with alot of things, but is there a hack around this?

Much thanks!

Hi – The uploader is not showing above the category description. Any idea why that may happen?

I added these 2 lines to my functions, which is allowing for classes and styles and images.
remove_filter( ‘term_description’, ‘wp_kses_data’ );
remove_filter( ‘pre_term_description’, ‘wp_filter_kses’ );

However, I’m having some issues with images. When in the lightbox with images in gallery, it won’t allow me to “Insert into Post” is this simply because it’s not a post? Also, it’s not allowing for captions. It’s spitting out the tags used, but in the Visual view it shows the caption.
[caption id="" align="alignright" width="215" caption="This is what caption copy looks like."] [/caption] Do captions not work?

Thanks for your help,
Christine

My example caption copy, above, turned into a caption…haha, basically it’s not doing that in my Taxonomy Description. Did I mention this is a description for Custom Taxonomies? Maybe that’s an issue as well.

Thanks again!

Hi Zack,

These seems to work great, except for one bug we’re having with it: paragraphs and line breaks are being stripped out of the HTML.

It’s easily reproducible:

1. Add a few paragraphs of text using the rich text editor, with a custom taxonomy attached to a custom post type in WordPress 3.0.1
2. Toggle between code view and rich text view once or twice. You should lose the line breaks immediately

Also, I seem to lose the line breaks without toggling — all I have to do is save the description. When I return to that description-editing-page later, the line breaks are gone.

Whatcha think? I’m happy to help debug.

Nabha

the same problem. remove_filter( ‘pre_term_description’, ‘wpautop’ );
helping to prevent on-load filtering, but nothing more about toggling and saving.

Is there any way to hide or truncate the description from the right hand list of categories on the summary / create page in wp-admin? My category descriptions are extremely long making this list a whole lot less usable (and ugly).

Hi, I love your plugin! I am running into a small problem — not sure if it’s a bug or something on my end.

When I add links in the Rich Text Editor, I notice that it adds additional quotes in the HREF attribute. Not only that, when I go through and clean up the errors, it seems to put them back in. I’m constantly having to repair this. Any thoughts on what might be causing it?

Thanks again!

Thank You for your plugin! It’s great.

But some problem.. In HTML-editor i put tag (for russian SE yandex), and it had cutted, when i save my post. Can you help me?

Hi! Great plugin, thanks for you work!
Btw, I have a question: I can add some tags as , , code view, etc to the editor?

FYI – on WordPress 3.1, you can’t create links using TinyMCE. Clicking the link button does nothing. :/

The plugin is working great on existing product categories but generates errors when trying to create new product categories.

Error message when trying to view any new product categories:

Catchable fatal error: Object of class WP_Error could not be converted to string in /home/xxxxx/public_html/wp-content/themes/rttheme11/functions/rt_breadcrumb.php on line 78

This is a great idea. I’m running WP 3.1.3 on a multisite installation in a child theme of Twenty Ten and for some reason the rich taxonomy descriptions just won’t show up. Hope you can advise! Thanks you.

Have an error on activation:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘wp_tiny_mce_preload_dialogs’ was given in /xxx/public_html/wp-includes/plugin.php on line 405

WordPress 3.2.1, Rich Text Tags 1.3.3, wp-e-commerce 3.8.6

I am using the WP-e-commerce plugin for an online shop, test site here
http://thecraftcircle.com.au/shop/?wpsc_product_category=yellows
I have installed the plugin, it definitely affects the descriptions for the product categories, I can do lists and align right  etc, BUT I can not do line/paragraph breaks. I read here this was fixed.
All I have done is install Rich Text plugin, I have not installed Yoast Simple Taxonomies plugin or changed any PHPShould I have to add Yoast or any code to my theme to make breaks work in my theme?Hope someone can help get me goingI think this piece of code in wpsc-grid_view.php is what displays the description. grid view is the layout of the category page

Zack…great plugin. Seems the issue regarding the missing paragraph breaks is still a problem. I’m running the latest version of the plugin. It saved breaks correctly, but the problem is that when I view the description in the editor, the breaks are missing. If I save the description without putting the breaks back in, I lose all of the breaks.

Any idea how to remedy this?

I found this happening even without this plugin. In my case there was another editor open in ANOTHER browser tab stuck in “loading”, and once I closed that tab, all the other scripts (editor related javascript) in the other browser tabs started working.

Zack…great plugin. Seems the issue regarding the missing paragraph breaks is still a problem. I’m running the latest version of the plugin. It saved breaks correctly, but the problem is that when I view the description in the editor, the breaks are missing. If I save the description without putting the breaks back in, I lose all of the breaks.

Any idea how to remedy this?

I too am having trouble with 3.3.1 and this plugin.  It does not display at all in my categories page. See screen shot.  Any idea when a fix will be about?

Hi,
I do not even know how I discovered this but when I put my entry in with the rich text editor toggled OFF using the following html, it seems to both give me paragraph breaks and keep them when I save again later, even with the rich text editor ON (which it is by default when you return)
Here is a whole lot of text in my description. Well there is even more, and more and moreThen we have a second paragraph, seems to work.
Even a third will be fine, hope this helps folks.

OK so you can not put HTML in the comments, would be nice if code tags worked here
so substitute the obvious for ] in the following and it should give you breaks that survive editing as mentioned in my previous post
[p style=”text-align: left;”]Here is a whole lot of text in my description. Well there is even more, and more and more.[/p][p style=”text-align: left;”]Then we have a second paragraph, seems to work.[/p][p style=”text-align: left;”] Even a third will be fine, hope this helps folks.[/p]

Using woocommerce and abundance theme from Kreisi. WordPress 3.3 Plugin 1.4.1
When I enter a Category screen, Product or regular WordPress post, I see my list of categories. The section on the left allows creation of a new category. That description text box has a “toggle rich text editor” link. It does nothing. When I select a category to edit. The description text field has no rich text toggle.As I said this also applies to regular wordpress post categories, not just woocommerce ones.
Any ideas? I am willing to supply a login.
I have used this plugin with successfully on other sites

I did some more testing regarding the plugin not showing in my category page. Luckily my client emailed saying love that plugin! He could see it. I coud not.

I logged in to his site using Firefox, Chrome and Safari. No button in the Category section. I am an Administrator.
I then logged in using his login and Password. He is also an Administrator. I could see the plugin and use it. What could be different about his profile and mine?We do not have any fancy user management plugins. We  are both Administrators.

Thanks for the reply

No, both Administrator and both profiles have “Disable the visual editor when writing” NOT checked.Weird thing I could always see the Upload/Insert icons for media images etc BUT they were in the top left corner of the page. Today all of the buttons are there everything works fine. I unfortunately have no idea what might have changed. I made a new user, all worked fine. So I will just move on.

Thanks again for your reply. Sorry I can not point you to a cause.

When I go to edit a category discription, the wyiswyg doesn’t show; I only see this:

Maybe something went broken in the upgrade. Any way to fix this?

Thank you for a great plugin.

Just upgraded to 1.4.1 to fix the editor, and it looks better.
However when I toggle the RTE, paragraphs are stripped, just like they did in older versions.

Any fix on this coming?

Just upgraded to the latest version, and the shortcodes I had installed are no longer rendering. I use them to pull in some info from WP-Table Reloaded.

Any thoughts on what I might need to change?

Thanks for pointing this out. In reworking the code, I forgot to add back the do_shortcode filter.

I am now uploading Version 1.5.1, which will be available soon.

Hi,

I have added the plugin to a site I am developing, and although it works fine for standard post categories, the editor and description field do not display for custom taxonomies. Any ideas?

 Wordpress 3.3.2 with RTT 1.6.2

I’ve found an issue on user profile with your plugin active: the password input fields just disappeared! I can’t change a user password anymore.

If I deactivate RTT, password input fields are there again.

Any idea about it?Am I the only one with this problem?

Thanks in advance.

I am having trouble with adding links to the category description.  I see the editor and the html and visual seem to be functioning.  However, the link inside of the description is not showing as a link.  It is only showing the anchor text but it is not clickable.

Nice plugin.  On the HTML tab in Edit mode, the control buttons are stacked one on top of the other.  Each button is the full width of the editor.  Is there a way to make them go across the top like they do in the wysiwyg “post” editor.

I suggest to add a strip_tags on except generator because, in my case, it doesn’t remove images:

return strip_tags(apply_filters(‘wp_trim_term_excerpt’, force_balance_tags($text), $raw_excerpt));

Hi!

On my local installation of WP 3.5.1 on the page
/wp-admin/edit-tags.php?taxonomy=category

appears the following:

Notice:
Undefined variable: css in
/Users/ixrevo/Sites/ixrevo.ru/wp-content/plugins/rich-text-tags/rich-text-tags.php
on line 168

And thanx for pretty cool plugin.

hello,
I don’t find any trace of my previous post… I was just saying that I didd a patch for your rich text tag plugin for i18n… if you want it I’ll be glad to send it to you.

hi, I activated your plugin rich-text-tags and then added this code to the archive.php of my WP theme. Now my categories have crashed, i.e. whenever I click on any category on my website, it gives me an error. This is my website: http://goo.gl/uVa0Tt. I have removed the plugin, I removed the code from my archive.php too, but it’s still not allowing me to access the categories. Kindly assist me in this. Thanks.

<?php

if(isset($wp_taxonomies)) {
// This is getting the friendly version of a taxonomy
// – not the hyphenated get_yoast_term_title()
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
if($term) {
echo '’.$term->name.”;
}
// If you have a taxonomy description, let’er rip!
if(function_exists(‘get_yoast_term_description’) && get_yoast_term_description()) {
echo wptexturize(get_yoast_term_description());
}
}
?>

Hi, I’m running WP 3.6 and i have a problem with this plugin.
If I insert an image using the media upload button, the category description is no more editable.
If i try to edit a category description with an image in it, I get an empty RTE windows.
The HTML of the descritpion is in the page ( I can see it in the code) but is not loaded into the RTE window!

Same happens to me. Empty visual and text editor. The content was uploaded fine in the main categories window, but once you open them in their own editor, the editors are empty. The original box does have the content. You can see it quickly flashing until the javascript adds the new editor. But the info is not passed to the new editor.

I’m experiencing a couple bugs on WordPress 3.8.1 with RTT 1.7.3. The biggest issue is that when there is any white space at the end of a taxonomy description, the editor will not display it for editing. You can overwrite it by putting in new content, but you cannot edit a description you’ve already saved in that case.

There is also an issue with the display of the taxonomy term listing in the admin. It looks like there’s some malformed html, it’s all garbled. I noticed one of the description excerpts stopped right in the middle of an attribute, I think they’re the issue. When the plugin is deactivated, the formatting is fine.

Thank you so much for your continued work on this plugin.

At first: Thank you for the great Plugin!

I found a Bug on the overview pages. If there is HTML and it is cutted in the overview, the whole term site will be not displayed correct. I solved the problem by Adding the following function:

function kill_term_desc_html( $terms ){

foreach ( $terms AS $key => $term ):
$term->description = strip_tags( $term->description );
$terms[ $key ] = $term;
endforeach;

return $terms;
}
add_filter( ‘get_terms’, ‘kill_term_desc_html’ );

Great plugin!

But I found a bugg using this plugin with WP 3.9.1, when and image is inserted in the description and save, the description will not load in the backend.

I displays correct in front end, but if you try to edit, it will not load the content in the RTE edit

When pasting a text with   in it, the text will not be loaded in the editor anymore when editing category descriptions for example

Hi,
Thank you so much for this great plugin! I’m having an issue where the add media button on top of the description area goes through the normal procedure, but when I click add image, nothing happens.
Can you help me out here?
Thank you!

Hi
I may be rushing it all too much, but I’ve already spent too much time on finding the source of the issue I have. It looks like your plugin inteferes with the Revolutionary Slider Plugin. When adding a RevSlider tag to a category description HTML the category page view crashes with ‘PHP Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in … wp-content/plugins/revslider/revslider.php on line 84’ – which is another ob_start()
One could say this is problem of the RevSlider, yet it works fine when inserted elsewhere (e.g. ordinary page, not category description page). Suppose both plugins should be modified, the question is only what xactly one should do to make it all work as expected?

Thank you in advance

Comments are closed.