抜粋記事を表示するthe_excerpt(); とリンクについて
-
自作テーマで、行き詰まっております。
ご指導お願いします。<article class=”post”>
<header>
<h1 class=”post-title”><?php the_title(); ?></h1>
</header>
<!– ここからアイキャッチ –>
<figure class=”thumbnail”>
<?php
if(is_home()||is_category() ||is_tag () ||is_date() ||is_archive() ||is_search()) {
if(has_post_thumbnail()) {
the_post_thumbnail();
} else {
echo ‘<img src=”‘.get_template_directory_uri().’/images/no_image.png” width=”160″ height=”120″/>’;
}
} ?>
</figure>
<!– アイキャッチここまで –>
<div class=”post-content”>
<?php
if(is_home() ||is_category() ||is_tag () ||is_date() ||is_archive() ||is_search()) {
the_excerpt(); //抜粋を表示する
} else {
the_content(); //全文を表示する
}
?>
</div>
</article>上記のようなコーディングで、抜粋を表示するところまでは満足しているのですが、
「抜粋記事の画面のみ」、タイトルとアイキャッチにリンクをつけたいのですが、どのような方法があるでしょうか?
- トピック「抜粋記事を表示するthe_excerpt(); とリンクについて」には新たに返信することはできません。