[wp-hackers] get post Id from url (when mod_Rewrite enabled)

Ozh ozh at planetozh.com
Thu Dec 27 12:59:53 GMT 2007


> When no url rewriting is used, I can grab the post id using $_GET['p'].
> However, when URL , rewriting is in use, and I use the post_name slug
> line inside the link, I can't grab the post id at all. I tried to play
> with the WP_rewrite class, and nothing. I also did a print_r($_GET) and
> no slug shows up (thinking I'll do a MySQL select to extract my id).

What about global $id ?

Ozh



More information about the wp-hackers mailing list