我有一个包含三个部分的目标网页 - 最近的博客部分,关于部分和Tweeter Feed。
这些元素的样式都相同且格式相同,但最新博客部分的内容并不完全正确。
具体来说,下面有一个更大的空间,<h2><a href="http://growingedgecoaching.com/blog">Growing Edge Blog</a></h2>
和<a href="http://growingedgecoaching.com/home"><span style="color:#b8bf33">Continue Reading</span></a></p>
比它应该更大,更大。
有什么想法吗?
这是相关代码:
<div id="landing-brief">
<ul>
<li>
<h2><a href="http://growingedgecoaching.com/blog">Growing Edge Blog</a></h2>
<p>
<?php
// Get the most recent post
$the_query = new WP_Query( 'posts_per_page=1' );
// Pull the excerpt
while ( $the_query->have_posts() ) : $the_query->the_post();
the_excerpt();
endwhile;
// Reset Post Data
wp_reset_postdata();
?>
<br /><br /><a href="http://growingedgecoaching.com/home"><span style="color:#b8bf33">Continue Reading</span></a></p>
</li>
<li>
<h2><a href="index.php?page_id=27">Meet Mary Anne</a></h2>
<p>Mary Anne is the founder of Growing Edge Coaching™, a coaching and consulting company, where she helps individuals and companies develop powerful strategies to move forward in their life, their work, or their business. Her coaching is founded on her 20 years of experience as a manager and senior leader in non-profits. <br /><br /><a href="index.php?page_id=27"><span style="color:#b8bf33">More About Mary Anne</span></a></p>
</li>
<li>
<h2><a href="#">Recent Tweets</a></h2>
<div id="twitter-feed">
<?php
include_once(ABSPATH . WPINC . '/feed.php');
$rss = fetch_feed('https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=Growing_Edge');
$maxitems = $rss->get_item_quantity(3);
$rss_items = $rss->get_items(0, $maxitems);
?>
<ul>
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<li>
<?php echo str_replace('Growing_Edge: ', '', $item->get_title()); ?>
</li>
<?php endforeach; ?>
</ul>
</div><!-- end twitter-feed -->
<br /><br /><a href="https://twitter.com/growing_edge"><p><span style="color:#b8bf33">Follow @Growing_Edge</span></p></a>
</li>
</ul>
</div><!-- end brief -->
#landing-brief {
width: 860px;
margin: 0 auto;
padding-bottom: 20px;
padding-top: 40px;
}
#landing-brief ul li {
display: inline-block;
padding-right: 20px;
vertical-align: top;
width: 250px;
}
#landing-brief ul li:last-child {
padding-right: none;
}
#landing-brief ul li p span {
color: #b8bf33;
}
#landing-brief #twitter-feed {
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 75%;
line-height: 1.5;
color: #333333;
margin-left: -28px;
}
#landing-brief #twitter-feed ul li {
padding-bottom: 5px;
}
答案 0 :(得分:1)
<h2><a href="http://growingedgecoaching.com/blog">Growing Edge Blog</a></h2>
<p>
<p>“Embrace the messy imperfect genius. Seek to be misunderstood by creative minds.” ~Ross Martin One thing I have learned over the years as an entrepreneur is that when I am in my most creative space, I have to release being a perfectionist and jump into my creative messiness. I need to create space that allows [...]</p>
<br /><br />
<a href="http://growingedgecoaching.com/home"><span style="color:#b8bf33">Continue Reading</span></a>
</p>
应该是这样的:
<h2><a href="http://growingedgecoaching.com/blog">Growing Edge Blog</a></h2>
<p>
“Embrace the messy imperfect genius. Seek to be misunderstood by creative minds.” ~Ross Martin One thing I have learned over the years as an entrepreneur is that when I am in my most creative space, I have to release being a perfectionist and jump into my creative messiness. I need to create space that allows [...]
<br /><br />
<a href="http://growingedgecoaching.com/home"><span style="color:#b8bf33">Continue Reading</span></a>
</p>
我建议您使用Chrome Developer工具栏等检查工具来检查页面,它会提供大量信息,帮助您找出问题所在。