Adding Snippets to WP Custom Category Pages

When I released WP Custom Category Pages, I wanted the category pages to not display any snippets or excerpts as to not create duplicate content. I’ve gotten a lot of emails about how to add this functionality to the tool though. Fortunately, it is really easy.

  1. Go to  the plugins tab in the left hand navigation and click editor.
  2. Select WP Custom Category Pages.
  3. Select the “/wp-custom-category-pages/templates/archive_category.php” file to edit.
  4. Then add the code below  after the post title is called.
  5. Hit the “Update File” button.

 

Post Title:

<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

Snippet Code
Add the following code right after the post title to add the excerpt:

<p><?php the_excerpt(); ?></p>

Below is a picture showing how this should look.

Adding Snippets

 

[wordpressresources]

 

 

 

1 thought on “Adding Snippets to WP Custom Category Pages”

  1. Hi Geoff,
    Turns a good plug-in into a great one for me!!

    I made a further amendment to the plugin, replacing the_excerpt with the_content to get a full version of the post on the archive page. Realise this contravenes your duplicate content goal pretty badly but it works for the UX I want to deliver

Comments are closed.