Category Description ONLY On First Category Page (4 posts)

  1. eselby
    Posted 3 years ago #

    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)

  2. chrisjb
    Posted 3 years ago #

    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.

  3. chrisjb
    Posted 3 years ago #

    I think I might have found this:


    I'll try and see if it works.

  4. Tamanna28
    Posted 2 years ago #

    use the get_query_var and is_category functions.

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic