0
我有這樣的代碼在foreach循環中:WordPress的店the_date()一個陣列
<?php $current_date[] = the_date('F Y'); ?>
什麼即時試圖做的是所有的日期收集到一個數組
但是當我print_r的我的數組,什麼都沒有出現......我該如何解決這個問題?
我有這樣的代碼在foreach循環中:WordPress的店the_date()一個陣列
<?php $current_date[] = the_date('F Y'); ?>
什麼即時試圖做的是所有的日期收集到一個數組
但是當我print_r的我的數組,什麼都沒有出現......我該如何解決這個問題?
the_date
是回聲,使用
<?php $current_date[] = the_date('F Y', '','', false); ?>
的false
關閉回顯。
http://codex.wordpress.org/Function_Reference/the_date
或佩卡有它get_the_date('F Y');
感謝我會盡快接受你的答案 – user1269625
'get_the_date()' –