Ways to get the page id in wordpress within the situation of friendly url?

Within the Loop: http://codex.wordpress.org/Function_Reference/the_ID

Outdoors the Loop: global $wp_query; $id = $wp_query->post->ID;

I am speculating you are speaking about doing the work through the Admin interface. Can't you simply add it in to the custom format textbox while using %post_id% string:


If you're inside the Loop (more often than not meaning inside the while(have_posts()) you need to have the ability to use: global $post; $id = $post->ID; to obtain the ID