使用自定义字段的奇怪问题

时间:2009-07-17 19:39:40

标签: css

我正在尝试从特定类别中提取内容并将其显示在主页上,同时显示从该条目的自定义字段中提取的图像。一切看起来都工作正常..第二个条目正常工作,但是对于第一个条目,只有图像链接回帖子,标题和阅读更多链接不被鼠标识别为链接。看看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&#8230;</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&#8230;</span></a></p>
</div>
</div>

以下是帮助我解释问题的屏幕截图...

alt text http://zacharydesigns.com/temp/wpsample.jpg

2 个答案:

答案 0 :(得分:1)

我接受了HTML输出,并将其粘贴到空白HTML页面中(添加了HTML / HEAD / BODY标记)。两个链接都呈现并正常工作。我在Firefox和IE中测试过。从它的外观来看,你的HTML输出就好了。

你有可能发布整个页面的输出吗?

- 亚当

答案 1 :(得分:0)

fixed-height-sidebar在CSS中做了什么?

这是两个条目之间的唯一区别。