我试图用一个插件来打印当月的WordPress的页面。怎样的PHP函数的输出功使用print_r的?
function RSB_Archive_Function($atts) {
$month = date('M');
$year = date('y');
$args = array(
'posts_per_page' => 10,
'offset' => 0,
'category' => '',
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'post_status' => 'publish',
'suppress_filters' => true);
print_r($month);
}
add_shortcode('rsb-archive', 'RSB_Archive_Function');
出于某种原因,该月的月“正在打印上面的标题以及在页面时我插入短码到网页?正如在这里看到:http://www.robotspacebrain.com/archive-coding/
任何想法,为什么这个我是这样吗?
这与'php'无关,它与你的内容(html)的结构和标记(css)以及何时调用此函数(输出'print_r'文本)无关。 –
究竟是什么是你的问题吗?你是问为什么输出打印在两个不同的地方而不是一个? –