A good[ish] website
Web development blog, loads of UI and JavaScript topics
Getting the post ID comes handy sometimes when writing conditional logic.
As simple as:
$post->ID;
I find it that sometimes when you're on a customized loop, the is_page($pageid)
doesn't work. Then it comes handy to do it something like this:
$post_id = $post->ID;
if (post_id == 1190) {
// Do something if true
} else {
// Do something else if false
}
global $wp_query;
needs to be evoked before calling the ID:
global $wp_query;
$post_id = $post->ID;
Thats it :)
Comments would go here, but the commenting system isn’t ready yet, sorry.