【发布时间】:2012-04-10 00:35:21
【问题描述】:
我正在尝试在 wordpress 中设置搜索页面的样式。在 search.php 中,我可以设置大部分页面的样式,但是下面的语句(我从原始未编辑页面中获得)生成内容。
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
这几乎可以按我的意愿显示页面,但是页面外有一些元素,使其扩展等。我无法弄清楚生成此内容的文件是什么!
使用说明我创建了一个 content-search.php 并将代码行更改为此...
get_template_part( 'content', get_post_format() );
哪个有效...但它没有显示任何内容,因为我不知道在看到原始页面时该在我的页面中放置什么。
有人知道吗?
【问题讨论】: