WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Question is clear I guess.

Normally, which template is returned when no search results are found. I would say search.php, but my parent theme's (twenty thirteen) search.php looks like this (slightly edited):

<?php if ( have_posts() ) : ?>

    <header class="page-header">
        <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentythirteen' ), get_search_query() ); ?></h1>

    <?php /* The loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
        <?php get_template_part( 'content', get_post_format() ); ?>
    <?php endwhile; ?>

    <?php twentythirteen_paging_nav(); ?>

<?php else : ?>
    <?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>

So, what is the none after content in the third last line? What exactly is fetched from content.php then?

share|improve this question
no-results.php template was initially used for this purpose. In the recent versions of WordPress (as of Twenty Thirteen theme), it was moved into content-none.php for consistency. – its_me Oct 13 '13 at 10:27
up vote 3 down vote accepted

get_template_part( 'content', 'none' ); will look for:

  1. content-none.php
  2. content.php

Twenty Thirteen does have content-none.php.

In general this is organized in such way to support dynamic lookups where first two-part template might or might not exist and fallback to more generic template, if necessary.

share|improve this answer
Thanks. Completely looked over content-none.php! – Bram Vanroy Sep 14 '13 at 11:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.