一直在尝试让图片出现在我们的搜索页面上,但只有当我能够让这两段代码正常工作时,它才会删除我们所有的网站格式和样式。我错过了什么吗(
新增代码-
<?php
/**
*
* search.php
*
* The search results template. Used when a search is performed.
*
*/
get_header();
?>
<?php get_sidebar(\'top\'); ?>
<?php
if (have_posts()) {
theme_post_wrapper(
array(\'content\' => \'<h4 class="box-title">\' . sprintf(__(\'Search Results for: %s\', THEME_NS), \'<span class="search-query-string">\' . get_search_query() . \'</span>\') . \'</h4>\'
)
);
/* Display navigation to next/previous pages when applicable */
if (theme_get_option(\'theme_top_posts_navigation\')) {
theme_page_navigation();
}
/* Start the Loop */
while (have_posts()) {
the_post();
get_template_part(\'content\', \'search\');
}
<div class="entry">
<?php
if(has_post_thumbnail()) { // check if the post Thumbnail
the_post_thumbnail();
}
else {
//your default img
}
the_excerpt(); //your short description
?>
</div>
/* Display navigation to next/previous pages when applicable */
if (theme_get_option(\'theme_bottom_posts_navigation\')) {
theme_page_navigation();
}
}
else
{
theme_404_content(
array(
\'error_title\' => __(\'Nothing Found\', THEME_NS),
\'error_message\' => __(\'Sorry, but nothing matched your search criteria. Please try again with some different keywords.\', THEME_NS)
)
);
}
?>
<?php get_sidebar(\'bottom\'); ?>
<?php get_footer(); ?>