2011-07-28 42 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> 
相關問題