我想通过以下代码获得帖子总数:
<?php
$published_posts = wp_count_posts()->publish;
echo \'Total posts: \'; $published_posts;
?>
结果是Total posts:
后面没有数字。我想通过以下代码获得帖子总数:
<?php
$published_posts = wp_count_posts()->publish;
echo \'Total posts: \'; $published_posts;
?>
结果是Total posts:
后面没有数字。这是基本的PHP字符串连接
echo \'Total posts: \'; $published_posts;
应该是echo \'Total posts: \' . $published_posts;
我在函数中不断遇到此代码的未定义索引错误。我做错了什么?function hire_more(){ $hire = $_GET[\'hire_more\']; write_log($hire); } add_action(\'wp_loaded\',\'hire_more\');