Missing content-search.php? #401

Closed
Ahrengot opened this Issue Feb 7, 2014 · 2 comments

4 participants

@Ahrengot

On line 22 of search.php there's a get_template_part() call that looks like this:

<?php get_template_part( 'content', 'search' ); ?>

but there doesn't seem to be any content-search.php template. Isn't this a bug, or am I missing something here?

@grappler

No, this is not a bug. If content-search.php does not exist then it falls back to content.php. The reason it is done like this is so to allow theme developers to addcontent-search.php` easily if need be but also this allows child theme authors to make changes too.

The codex explains it quite well. http://codex.wordpress.org/Function_Reference/get_template_part

@karmatosed
Automattic member

@grappler is correct - you can have that as an option and as this is a base theme this gives builders more options. I'm going to close this up as should be resolved.

@karmatosed karmatosed closed this Feb 10, 2014
@karmatosed karmatosed added the Close label Feb 10, 2014
@obenland obenland removed the Close label Feb 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment