Wordpressでサイトを制作しています。プラグインのNewpostcatchで、
画像-タイトル-日付と並んでいますが、
タイトルと日付の位置を入れ替えたいのですが、class.phpのカスタマイズがうまく行きません。
表示はショートコードを使っています。
[npc id="npcatch" posts_per_page="10" width="70" height="70" date="1"]
アドバイスをよろしくお願いします。
###該当のソースコード
php
1<ul id="npcatch"> 2<?php 3 if( $npc_query->have_posts() ) : 4 while( $npc_query->have_posts() ) : $npc_query->the_post(); 5 $date = ( $instance['date']['active'] == true ) ? '<span class="date">' . get_the_time( get_option('date_format') ) . '</span>' : ''; 6 7 if( has_post_thumbnail() ) { 8 $thumb_id = get_post_thumbnail_id(); 9 $thumb_url = wp_get_attachment_image_src($thumb_id); 10 $thumb_url = $thumb_url[0]; 11 } else { 12 $thumb_url = $this->no_thumb_image(); 13 } 14?> 15<li><a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php esc_attr( the_title() ); ?>"><img src="<?php echo esc_url( $thumb_url ); ?>" width="<?php 16 17echo esc_attr( $width ); ?>" height="<?php echo esc_attr( $height ); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>"/><span class="title"><?php the_title(); echo $date; ?></span></a></li> 18<?php 19 endwhile; 20 else : 21?> 22<p>no post</p> 23<?php endif; wp_reset_postdata(); ?> 24</ul>
###試したこと
<span class="title"><?php echo $date; the_title(); ?></span>の部分の
echo $date;とthe_title();を入れ替えてみましたが、反映されませんでした。
どうぞよろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/19 00:57