いつもお世話になっております。
ワードプレスプラグイン
Advanced custom Field Proで
groupフィールド「group1」を作成し、
そのgroup内の date_pickerフィールド で日付を設定しました。
group1グループの date_pickerで「2019年1月9日」と設定した日付から
月と日と曜日だけを出力したいのですがうまくいきません。
下記のように記述したところ
php
1<?php if(have_rows('group1')): ?> 2<?php while(have_rows('group1')): the_row(); ?> 3 4 5<?php $week = array("日", "月", "火", "水", "木", "金", "土"); ?> 6 7<?php $date = date_create(''.the_sub_field('schedule').''); echo date_format($date,'m/d') . "(" . $week[(int)date_format($date,'w')] . ")" ; ?> 8 9 10<?php endwhile; ?> 11<?php else: ?> 12<!-- 入力が無い場合の処理 --> 13<?php endif; ?>
2019年01月09日 01/28(月)
と、表示されてしまいます。
01月09日(水)
と出力するためにはどのような方法があるでしょうか。
どうぞよろしくおねがいします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。