Created
December 15, 2013 18:13
-
-
Save williamluisi/7976189 to your computer and use it in GitHub Desktop.
check if current 'page' is a node type of blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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