Extra category content

Extra category content is a simple plugin that adds a rich text editor to every category of your wordpress site, that gives you the opportunity to create a special description for the category, different from the default category description.

You can also add any HTML code to the description, so you can include an image, a table or a specially formatted text.

This plugin is useful if you want, for example, to add a general description or an image before the listing of the post from a category.

Requires WordPress 3.0 and PHP 5. Tested up to WordPress 3.3.1

Plugin price: $10 $5

USD 5.00 / Download

Usage

  • Enter WP admin
  • Edit one category
  • Fill the “extra description” field with the desired content
  • Press Update

Now the category has an extra content. You just need to make this content visible on your site. You can do this by editing your templates file and adding the following code:

<?php echo the_extra_category_content( ); ?>

Optionally you can specify a category id between the brackets, if you want to show an universal extra content trough all categories.

INSTALLATION

  1. Upload the folder ‘extra-category-content’ to the `/wp-content/plugins/` directory
  2. Activate the “Extra category content” plugin from the ‘Plugins’ menu in WordPress
  3. You are now ready to add extra content to your categories.

FAQ

Q: Do I need special skills to use this plugin?
A: Installing the plugin is easily done in 2 steps described in the Installation section.
To put the description on the site you just need to know in which templates file to add the code:

<?php echo the_extra_category_content(); ?>

Example:

  • For adding the extra category content before the posts listing in a category, you need to add the code in the file that displays this listing.
    This file depends from the theme that you are using (Eg.: wp-content/themes/theme-name/category.php, wp-content/themes/theme-name/archive.php, … )

  • For adding the extra category content in the sidebar, you need to add the code in the corresponding file (Eg.: wp-content/themes/theme-name/sidebar.php )

The “theme-name” is the name of the used theme.
Simple, isn’t it?

Q: For what to use this plugin?
A: If you need something personalized to show in the category pages this plugin would be a great help.

Examples:

  • Show a image for the category before the posts listing
  • Show a short description for the category before the posts listing
  • Show a table containing some information in the sidebar of one category
  • Adding a special link in one category before the posts listing,

Q: Can I display the content that I set for a category, in a post?
A: Yes, you can, if the post is subordinated to the category. In the post’s template file ( Eg. wp-content/themes/theme-name/single.php ) you insert the code as you would in the category listing:

<?php echo the_extra_category_content(); ?>

SCREENSHOTS

1. Editing a category and adding the extra content to it.

2. Adding the code to the template.

3. The final result on the edited category

4. Adding a banner for the category

CHANGELOG

Version 1.0: Initial release

Version 1.1:
  – Added compatibility with WordPress 3.3 ( please upgrade if you are using version 1.0 of this plugin )
  – Solved problem in the documentation: correct code to use is

<?php echo the_extra_category_content(); ?>


not   

<?php the_extra_category_content(); ?>

Version 1.2:  
 -  Added compatibility with custom taxonomies (eg. Woothemes video categories)
 -  Handle empty categories
 -  Display content from categories in subordinated posts

Version 1.3:  
- Bug fix: handle nested categories 

32 thoughts on “Extra category content

  1. Pingback: Extra category contentGwpteam.com | Gwpteam.com

  2. i want to add the content to all categories on top before the posts.you say to place the code below in category.php

    the problem i do not have category.php on my theme.

    what should i do?

    • Hello,

      category.php is an example for the default wordpress theme (twentyeleven). If you are using a custom theme, it is possible, that the post listing is done in other files. You can ask the theme creator, or you can try to find it yourself ( a good idea is to print something from the files that you think that do the listing, something like ‘echo “hello word”;’; when you find the right spot than you can insert the plugin’s code). Hope this helps you.

  3. Pingback: Banking Survey by Finantistii.roGWPTeam.com | GWPTeam.com

  4. Hi,

    I using the plugin and it great!

    But i have a duplicate content problem. each category have a few pages and the content appear in all the pages in the category. there is an option to display the category only on first page of each category?

    Thanks!

    Matan.

    • Hi,

      I’m glad that you like our plugin. The plugin doesn’t have an option to limit the display of it’s content. If you need the extra content to be displayed only on the newest post from each category, you can try something like this:

      //get the current category id
      $catid = $cat = get_the_category();
      $catid = $catid[0]->cat_ID;

      //get the newest post
      $query = new WP_Query( ‘cat=’ . $catid );
      $cat_posts = $query->posts;
      if( count( $cat_posts ) ){
      $latest = array_shift( $cat_posts );
      $latestId = $latest->ID;
      }else{
      $latestId = NULL;
      }

      //display content only if this post is the newest
      < ?php if( $post->ID == $latestId ): ?>
      < ?php echo the_extra_category_content( );?>
      < ?php endif; ?>

  5. Thanks for the quick response.

    i don’t need the content in the posts. i need that on each category page the content of the plugin will appear only on the first page of each category.
    if someone navigate to the second page of the category the content will not appear.

    Thanks!

    • OK, I misunderstood. In this case is simple. Use:
      < ?php if( !$wp_query->query_vars['paged'] ): ?>
      < ?php echo the_extra_category_content( ); ?>
      < ?php endif; ?>

      OR

      < ?php if( !is_paged() ): ?>
      < ?php echo the_extra_category_content( ); ?>
      < ?php endif; ?>

      • Where exactly do I use this piece of code? At top of page or after loop, where?

        Added it to the archive.php but all it did was show the code on actual page. Help with this would be appreciated.

    • Hi,

      Yes, it is possible, the same way you insert the content in category. You edit the tag and add the desired content. The only thing you have to do, is edit the tag file from your theme and insert the < ?php echo the_extra_category_content( ); ?> code in the desired place.

  6. I bought and installed your plugin great idea by the way… I unfortunately can’t get it to work… it’s just a blank… I add the in the category.php code but nothing works. I am running the them continuum and I have the latest WordPress 3.3.2

    • Hello,

      First of all thank you for choosing our plugins.

      The file category.php is an example for the default wordpress theme (twentyeleven). If you are using a custom theme, it is possible, that the post listing is done in other files.
      First make sure that when you save the extra content for a category, it get’s saved.
      Second, you have to find the file where your theme displays the categories. You can ask the theme creator, or you can try to find it yourself ( a good idea is to print something from the files that you think that do the listing, something like ‘echo “hello word”;’; when you find the right spot than you can insert the plugin’s code). Hope this helps you.

  7. You may have to do another bug fix… I noticed that when you edit in HTML mode in the WYSIWYG editor it doesn’t save the content… it work fine if you remember to switch back to Visual mode. Very frustrating. Please advise… thanks! Again great idea to include this feature.. I still can’t beleive WordPress hasn’t bother to introduce a category content editor. Great work.

    Also the –more– tag in WordPress doesn’t work in the Extra Category Content areas… any ideas? Works ok everywhere else… in posts no problem

    • I think the problem from the WYSIWYG is caused by the new version of WordPress, not the plugin.

      The plugin is not working “in the loop”, that is way the “more” tag is not working. We’ill keep in mind for the new version.

      Thank you

  8. Hi there

    I am having a problem with the parent category which is empty but it is pulling in a whole lot of other sub categories – problem is that it wont pull in the content description for the parent.. it pullls in the sub cat description. I have 1.2 – could i perhaps get the latest version or can you tell me how to fix this issue

    Thanks

  9. Pingback: Banking Survey by Finantistii.ro

  10. I disable the Visual Editor by default for the logged in user (ie. admin) but this causes the plugin not to display the extra content box on the Edit Category page.

    Instead of constantly enabling/disabling the VE is there a way to force this plugin to show the Extra box in HTML mode only?

  11. hey there. this plugin is exactly what i need, but I’m having trouble using it with the “Glow” theme by elegant-themes.com — I’m sure someone else has tried using this with elegant themes by now, I’m wondering where they pasted that line of code since there is no category.php file with elegant themes.

    Can anyone help here??? Thanks!

  12. Pingback: SEO para Categorías en Wordpress

  13. Thanks for your useful plugin!

    A quick question:
    Before installing the plugin, I had Permalinks set to /%postname%/

    Do I need to change Permalinks to /%category%/%postname%/ in order to properly display the category content and category URL?
    (e.g., mydomain.com/types-of-cars/toyota)

    Thanks

    Tony

  14. Hi, I’ve read up on your plug-in and it seems to be exactly what I need, so one quick question for you. Will the “Extra Description” content area accept shortcodes? Thank you.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>