Viewing 1 replies (of 1 total)
  • By default, Twenty Twelve shows excerpts, which strip out the HTML, when displaying search results. To change this, make a child theme, copy the file content.php from the parent theme to the child theme, open the child theme’s copy of the file, and make the following edit:

    On line 38, replace the code:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
        <div class="entry-summary">
            <?php the_excerpt(); ?>
        </div><!-- .entry-summary -->
    <?php else : ?>
        <div class="entry-content">
            <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
            <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
        </div><!-- .entry-content -->
    <?php endif; ?>

    With:

    <div class="entry-content">
        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
        <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    </div><!-- .entry-content -->

    Save the file, upload it to your server, and you should be good to go.

Viewing 1 replies (of 1 total)
  • The topic ‘Search Results Not Formatted’ is closed to new replies.