WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show content on last page of search or archive result (4 posts)

  1. ashworth102680
    Member
    Posted 4 years ago #

    I'm trying to show certain content on the last page of an archive/category or search result. So of all the pages of posts in the result, on the last page of the pagination, we want to show something only there.

    How might we go about doing this? I'm totally stumped!

  2. Taylor Dewey
    Member
    Posted 4 years ago #

    The $paged variable will tell you what page you are on, $wp_query->max_num_pages; will give you number of pages total. So..

    if ($paged == $wp_query->max_num_pages){
    //whatever you want to have displayed
    }
  3. ashworth102680
    Member
    Posted 4 years ago #

    This helped a ton. Excellent! Many thanks.

  4. Taylor Dewey
    Member
    Posted 4 years ago #

    You bet, glad it worked

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.