Trekdrop
Trekdrop

Reputation: 495

Pass post id to page and query post (wordpress)

I'm trying pass a post id to a page and query that specific post on the page. To pass the id I'm using this:

<a href="http://mySite.nl/the_page?post_id=<?php echo $post->ID ?>">Edit</a>

This will pass the id to the page in the url. For example:

http://mySite.nl/the_page/?post_id=123

Now how will get the id out of the url to query it on the_page? Or is there another method to do this?

Thanks!

Upvotes: 0

Views: 2087

Answers (1)

Tom McClure
Tom McClure

Reputation: 6729

Have you tried:

$_REQUEST['post_id']

Upvotes: 1

Related Questions