• 解決済 akumaru

    (@akumaru)


    index.phpに表示させる、記事一覧に表示しているサムネイルに title=”(記事名)” を入れたいのですが、できません。
    色々試したのですが初心者の為断念…

    titleに記事名ではなく、<?php the_title(); ?>が表示されてしまいます。

    よければご教授くださいm(_ _)m

    <?php if ( function_exists(“has_post_thumbnail”) && has_post_thumbnail() ) { the_post_thumbnail(array(200,160), array(“class” => “thumbnail”, “title” => “<?php the_title(); ?>”)); } ?>

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • <?php if ( function_exists(“has_post_thumbnail”) && has_post_thumbnail() ) { the_post_thumbnail(array(200,160), array(“class” => “thumbnail”, “title” => the_title() )); } ?> 

    でどうでしょう?

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック「PHPコードの中にPHPを書けない。」には新たに返信することはできません。