• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

get_page for aunt/uncle

Probably a dumb question...

but, how do I use get_page for a page other then the one I am on?

i.e. if I am on page 2a how do I do a get_page for page 1?

1.
--a
--b
--c
2.
--a
--b
--c
0
jasotasticon
Asked:
jasotasticon
  • 2
  • 2
1 Solution
 
jayarjoCommented:
If you know ID of that page you can do just:

$page = get_post($post_id = ID); // replace ID with actual numerical ID of the page
0
 
jasotasticonAuthor Commented:
jayarjo

I need this script to function dynamically, so I will not know the id or name of the page.

All the info I have will be that it is the previous aunt uncle.

J
0
 
jayarjoCommented:
Ok,

get_next_post() and get_previous_post() should give you next and previous pages to your current one. Then when you will have an IDs for these, you will be able to loop back or forward in time through pages, retrieve their children and do whatever you can imagine :)

Hope that helps.
0
 
jasotasticonAuthor Commented:
Thanks! Not exactly what I was looking for, but this led me to my answer.

I'm a newbie, and I really appreciate your help!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now