2011-07-28 98 views
1

我已经编写了该代码以循环浏览最近的6篇帖子,并在标题下方的最新消息框中显示它们的标题。该帖子显示正常,但无法点击进入帖子。 继承人的代码loop语句在最新消息框中显示最新帖子

<div id="freshlyWrapper"> 
<div id="freshlyposts"> 
<?php 
$freshlyIonised = new WP_Query(); 
$freshlyIonised->query('category_name=featured&showposts=6'); 
while($freshlyIonised->have_posts()): 
$freshlyIonised->the_post(); 
?> 

<div class="freshlyionisedbox"><h3><?php the_title(); ?><a href="<?php the_permalink() ?>"></a></h3> 
</div> 

回答

2

解决您的a内:

<a style='text-decoration: none; color: black;' href="<?php the_permalink() ?>"> 
    <?php the_title(); ?> 
</a> 

现在你的标题是外面的那些记者联系

+0

太好了。但问题是,现在它们显示为蓝色并且被强调。我希望文本是黑色的而不是下划线 –

+0
+0

FTL的内嵌样式。 –

0

是的,你需要设置在标题中的一个标签:

<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3> 
0

并在固定链接函数后添加分号:

<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> 
相关问题