Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
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
<?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();?>
Posted
Updated 16-Feb-16 12:15pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900