抱歉,如果这有点愚蠢,但我以前从未涉足过 PHP。
基本上,我使用的是名为 Kingsize 的高级 wordpress 主题,它很漂亮,但没有在帖子中显示作者。我已经设法在个人帖子(通过编辑 single.php)和帖子列表(loop.php)上找到它。
我想我做对了,因为它出现在那里。问题是在这两种情况下它都在日期下方的行上,我希望它在同一行上:
http://bathastronomers.co.uk/category/bath-astronomers/
我想如果我在 style.css 中找到“post_date”我就能弄明白,但它似乎不在那里!
此外,我想去掉日期和作者之前的小图标。
有什么想法吗?
这里是single.php中的相关代码:
<?php
if( $data['wm_date_enabled'] == '1' ) { //data is enabled
?>
<div class="metadata">
<p class="post_date"><?php the_time(get_option('date_format'));?></p>
<p class="post_author"><?php the_author(); ?></p>
</div>
<?php}
?>
最佳答案
将其更改为:
<div class="metadata">
<p>
<span class="post_date"><?php the_time(get_option('date_format'));?></span>
<span class="post_author"><?php the_author(); ?></span>
</p>
</div>
关于php - 使用 CSS 设置 PHP 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19290684/