Enabling HTML and shortcodes in your Category Descriptions

by nik0 Banned
7 replies
  • SEO
  • |
To improve the rankings of your categories there's a simple trick, adding unique content to them instead of only those read more snippets.

You can do that by either using excerpts with unique written content and enable that in your category.php file, or you can use the category description field.

However that often doesn't allow html or short codes so here is a quick fix:

Add these 2 lines of text to your functions.php and the problem is solved:

Code:
remove_filter('pre_term_description', 'wp_filter_kses');
add_filter( 'category_description', 'do_shortcode' );
Then you can also install an accordion script so that you don't have a whole lap of text showing up on the category page that might distract the buyer.
#category #descriptions #enabling #html #shortcodes
  • {{ DiscussionBoard.errors[8907400].message }}
    • Profile picture of the author nik0
      Banned
      Nice but I have a theme that doesn't use the category.php at all so I use the above code.
      {{ DiscussionBoard.errors[8907436].message }}
      • Profile picture of the author yukon
        Banned
        Originally Posted by nik0 View Post

        Nice but I have a theme that doesn't use the category.php at all so I use the above code.
        You could copy the archive.php (I guess that's what your theme has) & rename it as category.php. Just an option If you wanted the full WP text editor on the category admin. page.

        [edit]
        You would still need the category plugin mentioned in the link I posted above.
        {{ DiscussionBoard.errors[8907443].message }}
        • Profile picture of the author unifiedac
          This is a pretty good idea. I never really thought about it, but on my affiliate content sites it would be useful to have an affiliate link associated with the category (company) name on each post.
          Signature
          {{ DiscussionBoard.errors[8907456].message }}
        • Profile picture of the author nik0
          Banned
          Originally Posted by yukon View Post

          You could copy the archive.php (I guess that's what your theme has) & rename it as category.php. Just an option If you wanted the full WP text editor on the category admin. page.
          It doesn't use archive.php either or anything similar to that. I don't know how they programmed this theme but it's done in a very odd way.

          EDIT: It does have a category.php file but in the wp-includes folder, not in the theme folder.
          {{ DiscussionBoard.errors[8907466].message }}
          • Profile picture of the author yukon
            Banned
            Originally Posted by nik0 View Post

            It doesn't use archive.php either or anything similar to that. I don't know how they programmed this theme but it's done in a very odd way.
            Is the theme on that site you had with the tillers? If so, I guess they probably have something like products.php instead of a category page (category.php) since it's more of an eCommerce setup than a regular blog?
            {{ DiscussionBoard.errors[8907483].message }}
            • Profile picture of the author nik0
              Banned
              Originally Posted by yukon View Post

              Is the theme on that site you had with the tillers? If so, I guess they probably have something like products.php instead of a category page (category.php) since it's more of an eCommerce setup than a regular blog?
              That theme indeed.

              All the pages that could be interpretated as a category page look like this:

              <?php get_theme_file( 'header' );get_theme_block( 'header' );get_theme_block( 'mainmenu' );if (is_home()):get_custom_theme_block( 'contentarea-frontpage-latestposts', 'side', 'col' );elseif (is_page()):get_custom_theme_block( 'contentarea-frontpage-staticpage', 'side', 'nocol' );endif;get_custom_theme_block( 'footerone' );get_custom_theme_block( 'footertwo' );get_theme_file( 'footer' ); ?>

              Name of that one is front-page.php and other pages named like:

              home.php
              index.php
              page.php
              templatetwo.php
              templatethree.php
              templatefour.php
              page-frontpage.php
              post-frontpage.php
              post-blog.php
              page-single.php
              etc

              Have the same format as pasted above.
              {{ DiscussionBoard.errors[8907498].message }}

Trending Topics