Drupal 7 Search results have no theme or format (no HTML) I have a Drupal 7 installation with about 10 custom types and a custom theme. I have a search form in the site's header displayed with 

$block = module_invoke('search', 'block_view', 'form');
print render($block);


This code is in an include file called by my page.tpl.php, it's not actually inside a block.

If there are no search results, the search page displays (mostly) correctly and it uses the search-results.tpl.php template in my theme. 

However, if there are search results, I get an unformatted page.  It's just the search results (with their associated HTML p tags, etc.) with no site HTML.  No head tag, no body tag and none of the custom theme's HTML. 

By using advanced search, I have identified, specifically, that one of my custom types is causing this issue.  The confusing thing is that this type just has a title and a body text.  Other, more complicated types are not causing this issue.  When I limit it by type, I get the correct output.

How can I get the search results to show up on a regularly themed page?



EDIT

I have also tried:

echo drupal_render(drupal_get_form('search_form'));
I don't know if this will help anyone; but, just in case, here is the solution to my problem.

One of my content types (the one causing the issue) is only viewable in the public site via ajax.  As such, I had this code in my function *mytheme_node_view_alter(&amp;$build)*

//show only output for popup
if($build['#node']-&gt;type=="blue_pop_up"){
    echo $build['#node']-&gt;body["und"][0]["safe_value"];
    die();
}


This was breaking my search results page when it found content of this type. I simply added this to the code:

//show only output for popup
    if($build['#node']-&gt;type=="blue_pop_up")
    {
        if($build["body"]["#view_mode"] != "search_result")
        {
            echo $build['#node']-&gt;body["und"][0]["safe_value"];
            die();
        }
    }