WordPress.org

Support

Support » Plugins and Hacks » Category Description ONLY On First Category Page

Category Description ONLY On First Category Page

  • What is the conditional code to echo category_description on just the first page of a category archive?

    (client wants to avoid “duplicate content” across multiple category post pages)

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m also looking for conditional for “category first page”. I have content displayed above the paginated content, which shouldn’t be displayed on category-name/2.

    Did you find the answer to this eselby? I couldn’t find anything in the conditionals codex resource.

    I think I might have found this:

    is_category()&&!is_paged()

    I’ll try and see if it works.

    use the get_query_var and is_category functions.

    <?get_header()?>
    <?
    if (is_category()) {
      $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
      if ($page == 1) {
        echo category_description(); //you don't need to include the category id on the actual category page - wordpress figures it out.
      }
    }
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category Description ONLY On First Category Page’ is closed to new replies.
Skip to toolbar