2011-07-28 22 views
1

私はこのコードを書いて、最後の6つの記事をループし、タイトルをヘッダーの最新のニュースボックスに表示します。投稿はうまく表示されますが、クリックして投稿に行くことはできません。 は、相続人のコード最新のニュースボックスに最新の投稿を表示するには

<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

permalink関数の後にセミコロンを追加します:

<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> 
関連する問題