Wordpress循环通过自定义php页面中的帖子

问题描述:

我试图在自定义的php页面中循环播放帖子,但无论我做什么,这里都没有发现帖子是我在my-custom-page.php中写的代码



我尝试了什么:



I am trying to loop through posts in a custom php page but no matter what I do, no posts are found here is the code I wrote in my-custom-page.php

What I have tried:

<?php 
require_once("/wp-load.php");
get_header();
if(have_posts()) : 
 while(have_posts()) : the_post(); 
        $count_posts = wp_count_posts();
       echo $count_posts;
 endwhile;
endif; 
get_footer();?>

count_posts = wp_count_posts();
echo
count_posts = wp_count_posts(); echo


count_posts ;
endwhile;
endif;
get_footer(); ?>
count_posts; endwhile; endif; get_footer();?>