Well… What is a “next page”? Regarding to posts this has chronological meaning…
So, can you tell what is “next page”… for you?-)
Well, yeah, but I want one that goes through the list of pages not posts.
I suppose it would be more like the next_posts_link for single posts. But I want one for the page template which only shows a single page and not a single post or multiple posts.
…something that will go to the next one in the list produced by this template tag: wp_list_pages
What is list of pages? How you suppose them to be ordered?
wp_list_pages
…you order them in wordpress admin
Well, yes, i would say you need your own query and the Loop…
But because of you talk about a single page — you need your own function to get your prev. and/or next page… in order you defined.
So, i believe, you need your own function.
hmmm… you know how to do that?
Sorry, I’m not that clever. Wouldn’t know where to start in achieving it, besides reading through the php.net website! I’m not a php programmer as you may have noticed.
…thanks for you speedy responses Dor. Really appreciate it.
Well… Whether you’ve noticed it or not — i’m not a programmer at all 🙁
🙂 Honest.
I guess you need to have page id… Probably then i would try with SQL query like that (not a real query! in meta-language, let’s say):
SELECT id, title WHERE post_type = "page" and id > this_page_id LIMIT 1;
(you’ll need to check some things before trying this for real)
This will give you id an title for “next” (by id) page…
This is a wild guess.
Most probably i would first try this with wp_query
, not ‘raw’ SQL query…
Hope this helps… And hope somebody else helps too.
WOW! SQL query!!! …well, I can barely read what is happening in php. No idea about SQL queries. I must learn though.
Yeah, i think the query_posts might would have been cool if you can limit it to pages and then maybe the next previous, thing could kick in.
…I’ll check here every now and then to see if there is a response.
Great, you’ve read my answer, so now i will blame myself 🙂
The point is that you hardly need to get “next by ID” — if you have you pages structured, you need “next in structure”.
So, you can take a look at wp-includes/post-template.php — how wp_list_pages()
does this.
Well, it uses Walker_Class, not sure if this can help you.
Sorry for the noise.