我试图从特定类别中拉出内容,并让它们与从该条目的自定义字段中拉出的图像一起出现在主页上。一切看起来都很正常。第二个条目工作正常,但是对于第一个条目,只有图像链接返回到帖子,标题和阅读更多链接不被鼠标识别为链接。查看html,似乎php可以正常打印所有内容,所以我认为这一定是CSS的问题,但我清除了所有相关样式,但链接仍然无法识别。
这是我为主页准备的php
<?php
// Show custom fields from Food Category
query_posts('showposts=2&cat=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php
// This is added to show <!--more--> on home page
global $more;
$more = 0;
?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<img src="<?php
$values = get_post_custom_values("food_thumb"); echo $values[0]; ?>" alt="" /></a></div>
<div class="span-3">
<p class="smallTitle">
<a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?></a></p></div>
<div class="span-1 theDate">
<?php the_time('m.d.y') ?>
</div>
<div class="span-4">
<?php the_content('<span class="moretext">Read more...</span>'); ?>
</div>
<?php endwhile; ?>HTML输出看起来很好..
<div class="span-4 fixed-height-sidebar">
<div class="smallthumb"><a href="http://southendseattle.com/?p=24" rel="bookmark" title="Permanent Link to Food Test 1"><img src="foodthumb.jpg" alt="" /></a></div>
<div class="span-3">
<p class="smallTitle"><a href="http://.com/?p=24" rel="bookmark">
Food Test 1</a></p></div>
<div class="span-1 theDate">
07.16.09</div>
<div class="span-4 fixed-height-sidebar">
<p>Mmmmmmmm. Food. Aliquam libero libero, luctus ut tristique pulvinar, euismod at diam. In hac habitasse platea dictumst. Lorem ipsum dolor sit amet, <a href="http://southendseattle.com/?p=24#more-24" class="more-link"><span class="moretext">Read more…</span></a></p>
</div>
<div class="smallthumb"><a href="http://.com/?p=3" rel="bookmark" title="Permanent Link to Food test page -2"><img src="http://.com/wp-content/uploads/2009/07/foodthumb2.jpg" alt="" /></a></div>
<div class="span-3">
<p class="smallTitle"><a href="http://.com/?p=3" rel="bookmark">
Food test page -2</a></p></div>
<div class="span-1 theDate">
07.12.09</div>
<div class="span-4">
<p>“Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In nec odio vitae nunc euismod vulputate. Integer aliquam ullamcorper tortor, nec suscipit magna viverra in. Nunc urna neque, dapibus id congue et, dignissim vitae augue. Aliquam et bibendum lacus. <a href="http://southendseattle.com/?p=3#more-3" class="more-link"><span class="moretext">Read more…</span></a></p>
</div>
</div>这里有一个屏幕截图来帮助解释我的问题。
alt text http://zacharydesigns.com/temp/wpsample.jpg
发布于 2009-07-17 20:55:21
两个链接都呈现并正常工作。我在Firefox和IE上测试过。从外观上看,您的HTML输出很好。
你能发布整个页面的输出吗?
--亚当
发布于 2009-07-19 15:37:35
fixed-height-sidebar在CSS中做什么?
这是两个条目之间唯一的区别。
https://stackoverflow.com/questions/1145272
复制相似问题