admin管理员组

文章数量:1323723

$orders = get_posts(array(
  'post_type' => 'lp_order',
));
foreach ($orders as $order) {
  // get all order data code 
}
  1. This the code I will try to learnpress plugin order post type front end display but it's not working I also check his capability.

    please suggest me I am a beginner in WordPress so no more ideas.

  2. I try a different method like this:

$args = array(
  'post_type' => 'lp_order',
)

$tech_posts = new WP_Query($args);
if ($tech_posts->have_posts()) :
  while ($tech_posts->have_posts()) : $tech_posts->the_post();
    //order code
  endwhile;
endif;

本文标签: pluginscustom post type getposts() function not work