月別ページの年月の表記を変更する場合

パーマリンク設定をデフォルトにしている場合。

<?php if(is_month()): ?>
<p id=”pagetitle”>
<?php
$thisyear = substr($m, 0, 4);
$thismonth = substr($m, 4, 2);
echo $thisyear . ‘年’. $thismonth . ‘月’;
?>
</p>
<?php endif; ?>

パーマリンク設定をデフォルト以外にしている場合。(←これにしてる。)

<?php if(is_month()): ?>
<p id=”pagetitle”>
<?php
echo $year . ‘年’ . $monthnum . ‘月’;
?>
</p>
<?php endif; ?>

検索


タグクラウド

iPhone mac php TV Windows いとおし おやつ なでしこジャパン アニメ スポーツ トレッキング ハルジオン式 バイク ミニベロ モンベル レビュー 仕事 大阪の山 建築 登山靴 資格 音楽 食べてみた

今月人気の記事

月別アーカイブ