• with the loop i can query for the most recent posts for the first page it will return 10 results, on the next page again 10 results and so on

    while in the loop i want to know what position that post has in the resultset

    so the first post on the page 2 would need to return 10 or 11 (depending on it being 0 based or not)

    how can i find that ? is it a variable that is stored in the wp_query or so ?

    thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bowa

    (@bowa)

    no-one who can help me ?

    i thought this would be a really easy question, another approach, is there a way to know from the code if i am on the homepage or if i am on one of the paged-pages from the homepage content ? in other words if i am in / or /page/2/ but i would prefer doing it without having to look at the request uri, this information should be available somewhere? no ?

    Well, I don’t have the answer to your question… I think I’d suggest grabbing one of the “paged navigation” plugins (there’s a handful of ’em out there) and examine the code to see how they do it.

    For instance, maybe check out WP-PageNavi?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The Loop and number of results’ is closed to new replies.