if($type == get_post_type($wp_query->post->ID)) return true;
return false;
}
-
+/*
+ * This function returns true when the current page is the page given by ID
+ * or a descendent thereof.
+ */
+if (!function_exists('is_in_tree')) {
+ function is_in_tree( $pid ) {
+ global $post;
+ if ( is_page( $pid ) ) {
+ return true;
+ }
+ if ($post) {
+ $anc = get_post_ancestors( $post->ID );
+ foreach ( $anc as $ancestor ) {
+ if( is_page() && $ancestor == $pid ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
add_action('thematic_searchloop', 'mytheme_search_loop');
// End of the Contextual/Highlight Search functions
?>