http://codex.wordpress.org/Function_Reference/locate_template Also take a look at get_queried_object_id() rather than global $post; $post->ID and the args for wp_get_post_tags() - you can have it return just names and then you should be able to array_pop() it.