Not displaying any articles on a custom made file in Wordpress
I have created the file latest.php in the public_html so that when I go to www.domain.com/latest.php it will show me the latest articles. Sadly, nothing of the posts came up. Later, I will sort them with other ways (mostly based on custom fields).
This is my latest.php file (I removed any styling for better understanding)
<?php include("wp-load.php"); ?>
<?php 开发者_Go百科get_header(); ?>
<?php wp_head(); ?>
**AND HERE IS WHAT I COPY-PASTED FROM MY INDEX.PHP THAT IS WORKING**
<?php while (have_posts()) : the_post(); ?>
<a title="" href="<?php echo get_permalink(); ?>" ><?php the_title(); ?></a>
<?php endwhile; // End the loop ?>
<?php posts_nav_link(' · ', 'previous page', 'next page'); ?>
My question is how can I make it possible to show the latest articles with pagination ? wp-load.php , wp_head and get_header are loaded correctly.
Should I use an entire different method for my task? If yes, which one?
wordpress does not works this way... if you want to make a custom page. create a new template page in the themes folder and then (from back end) create a new page and assign that template to that page.. this way you can put you custom code in the template file and wordpress can process it
精彩评论