I created a Forum plugin and would like to have a cystomized search result template, I added the following excerpt in the plugin execution file:

```
add_filter('single_template', 'pagina_topicos');

function pagina_topicos($single) {
    global $wp_query, $post;

/* Informando o Modelo de Página das Aulas */
if ($post->post_type == "stopicos"){
    if(file_exists(plugin_dir_path( __FILE__ ) . '/single-topico.php'))
        return plugin_dir_path( __FILE__ ) . '/single-topico.php';
}

  if( $wp_query->is_search && $post_type == 'stopicos' )
  {
    return plugin_dir_path( __FILE__ ) . '/archive-stopicos.php';
  }

    return $single;
}

```

I use the following form in the search:

```
 <form role="search" action="<?php echo site_url('/'); ?>" method="get" id="searchform">
                    <input type="text" class="submit-search form-control input-lg" placeholder="Buscar" />
                    <input type="hidden" name="post_type" value="stopicos"/>
                    <span class="input-group-btn">
                        <button class="btn btn-info btn-lg" type="submit" value="Search">
                            <i class="glyphicon glyphicon-search"></i>
                        </button>
                       </form> 

```

What can be wrong so that the model I customized is not loaded?