NO IMAGE

WordPress 年でフィルターしつつ、現在の年を表示させる

  • 2017年2月27日
  • 2017年2月27日
  • WordPress
  • 35view

デモ
http://kato.space/wp/wordpress/

上のデモで、2013年
http://kato.space/wp/wordpress/2013/
の2013をページに表示させたい。
問題は、page/2/ とか来た場合だが、
まずは確認

<h2><?php single_cat_title()?>の記事一覧</h2>

上記に、前に出したい

<h2><?php
	echo get_the_date('Y');
	single_cat_title();?>
	の記事一覧</h2>

これだと現在の年も出るので、

 

<h2><?php
	$now = date('Y');
    if($now != get_the_date('Y')){echo get_the_date('Y').'年  ';}
	//echo get_the_date('Y');
	single_cat_title();?>
	の記事一覧</h2>

とか

NO IMAGE
最新情報をチェックしよう!

    Warning: Trying to access array offset on value of type bool in /home/xsvx1010357/kato.space/public_html/wp/wp-content/themes/the-thor/template-parts/single-prevnext.php on line 37

    Warning: Trying to access array offset on value of type bool in /home/xsvx1010357/kato.space/public_html/wp/wp-content/themes/the-thor/template-parts/single-prevnext.php on line 38

    Warning: Trying to access array offset on value of type bool in /home/xsvx1010357/kato.space/public_html/wp/wp-content/themes/the-thor/template-parts/single-prevnext.php on line 39

  • Warning: Trying to access array offset on value of type bool in /home/xsvx1010357/kato.space/public_html/wp/wp-content/themes/the-thor/template-parts/single-prevnext.php on line 83

    Warning: Trying to access array offset on value of type bool in /home/xsvx1010357/kato.space/public_html/wp/wp-content/themes/the-thor/template-parts/single-prevnext.php on line 84

    Warning: Trying to access array offset on value of type bool in /home/xsvx1010357/kato.space/public_html/wp/wp-content/themes/the-thor/template-parts/single-prevnext.php on line 85
>最強のWordPressテーマ「THE THOR」

最強のWordPressテーマ「THE THOR」

システムの構築・保守運用「   」 社内システム担当が欲しいが、専属で雇うほどの仕事量はない。 必要な時に必要なだけ頼りたいというお悩みを持つ企業様へ専門知識を持って対応を行っております。 サーバから各種システムまで自社・他社で構築されたシステムに対してサポートを行っております。

CTR IMG