アムの初心者は、post_status =>「公共」パラメータを渡していますがWordpressの中で起こったものを意味し、ワードプレスでWp_queryが動作しませんか?
select * from wp_posts where post_status ='public'
私はmysql_query.But上記のようなクエリやショーの詳細を書きたいですその取得結果post_status =「auto_craft」をコーディング私のワードプレスの下に、アムとても混乱はなぜ結果が、午前の上映は= '国民post_statusを渡す
Wordpressの:
<?php
$args = array(
'posts_per_page' => -1,
'post_status' => 'public'
);
$post_query = null;
$post_query = new WP_Query($args);
var_dump($post_query->request);
if ($post_query) {
while ($post_query->have_posts()) : $post_query->the_post();
echo "fdsfl;dslfgsss";
global $post;
echo $post->post_title;
endwhile;
wp_reset_query();
}
?>
私のABで何が問題になっていますああコーディング?私のvar_dumpには、以下のような結果が得られました。
"SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' ORDER BY wp_posts.post_date DESC "
1 = 1とは何ですか? 'コードpost_status' = '国民
マイカスタマイズチェックしていない:あなたがと交換してくださいすることができますが、間違ったpost_status
値を渡す必要が
$post_status = empty($postarr['post_status']) ? 'draft' : $postarr['post_status'];
if ('attachment' === $post_type && in_array($post_status, array('public'))) {
$post_status = $postarr['post_status'];
} elseif ('attachment' === $post_type && in_array($post_status, array('private_soundcloud'))) {
$post_status = 'private_soundcloud';
} else {
if ('attachment' === $post_type && !in_array($post_status, array('inherit', 'private', 'trash'))) {
$post_status = 'inherit';
}
}
あなたの返信はありませんが、私はレコードpost_status = 'db'の 'public'を持っています。 –
'public'のようにカスタム' post_status'を作成する必要がありますか? – purvik7373