我正在努力简化我的WordPress日志的设计。对于出现在帖子或帖子标题上方的元数据,我所希望的就是它出现在一个单独的、相当不起眼的行中。
伪代码将如下所示:
$date $category $edit它实际看起来是这样的:http://johnlaudun.org/20120828-isaac-at-9pm/
此行的CSS为:
.entry-meta {
font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
font-size: .75em;
text-transform: uppercase;
}
.entry-meta p {
white-space: nowrap;
}
.entry-meta a {text-decoration: none;}
.entry-meta .date {color: #000;}
.cat-links a {color: #436EEE;}
.edit-link a {color: orange;}PHP是:
<div class="entry-meta">
<p>
<?php if ( ! is_page() ) : ?>
<a href="<?php the_permalink(); ?>">
<?php the_time( 'Y M d' ); ?></a>
<?php endif; ?>
<span class="cat-links">
<?php the_category( ', ' ); ?></span>
<span class="edit-link">
<?php edit_post_link( __( 'Edit', 'chunk' ) ); ?></span>
</p>
</div>它会在浏览器中生成以下输出:
<div class="entry-meta">
<p>
<a href="http://johnlaudun.org/20120828-isaac-at-9pm/">
2012 Aug 28</a>
<span class="cat-links">
<a href="http://johnlaudun.org/category/status-2/" title="View all posts in status" rel="category tag">status</a></span>
<span class="edit-link">
<a class="post-edit-link" href="http://johnlaudun.org/wordpress/wp-admin/post.php?post=5052&action=edit" title="Edit Post">Edit</a></span>
</p>
</div>在我看来,在一个相当简单的输出中插入某种类型的换行符,我错过了什么?
发布于 2012-08-29 22:48:44
看看style.css,第191行:
.cat-links, .tag-links {
display: block;
}尝试使用:display: inline;
https://stackoverflow.com/questions/12180555
复制相似问题