Skip to content

Instantly share code, notes, and snippets.

@williamluisi
Created December 15, 2013 18:13
Show Gist options
  • Save williamluisi/7976189 to your computer and use it in GitHub Desktop.
Save williamluisi/7976189 to your computer and use it in GitHub Desktop.
check if current 'page' is a node type of blog
<?php
//check if pg is node
if (arg(0) == 'node') {
$nid = arg(1);
//load current node
if ($nid) {
$node = node_load($nid);
if($node->type == 'blog') {
//do something here.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment