chris-melchior
Member
Posted 2 years ago #
Is is possible to get an automatically updating sitemap, (listing of Posts), on one Page only? I don't want "latest posts" or "archives" on all pages or posts, but only on one Page only, can I do that, or is there another way to get such a site-map onto a single Page?
thanks :)
Chris
This in a Page Template will work:
<?php
$args=array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'List of All Posts';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
chris-melchior
Member
Posted 2 years ago #
Thanks very much, will try that soon :)
Chris
chris-melchior
Member
Posted 2 years ago #
That works well, thanks!
Chris