I’m using the following code to query a custom post type. Despite being set to “post_status = publish” it is still showing blank “auto draft” pages on the front end, though I cannot locate them on backend. How do I get rid of these posts?
<?php
global $themeple_config;
$query = new WP_Query( array(
'post_type' => 'testimonial',
'post_status' => 'plublish',
'orderby' => 'post_date',
'order' => 'DESC'
) );
It was simply a typo. “
plublish
” should have been “publish
” obviously.Correct code is as follows:
Credit to @yuyokk for noticing.
see the following code if it can help you.
for more information click here