Displaying a list of categories on a static php page
-
Hi – I have managed to display my latest post and my post titles on my static .php landing page see here. How do I display a category list for example for the right hand section rather than post titles.
<?php // Include WordPress define('WP_USE_THEMES', false); require('../walkingholidays/wp-load.php'); query_posts('showposts=1'); ?>
My PHP for the latest post:
<div class="blogright"><?php while (have_posts()): the_post(); ?> <h2>Collett's Blog - <?php the_title(); ?></h2> <?php the_excerpt(); ?> <p><a href="<?php the_permalink(); ?>">Read the latest from Collett's Mountain Holidays Blog...</a></p> <?php endwhile; ?></div>
My PHP for the latest post titles x5:
<div class="blogright"> <h2>Post Titles</h2> <?php query_posts('showposts=5'); ?> <?php while (have_posts()) : the_post(); ?> <?php the_category( $separator, $parents, $post_id ); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br /> <?php endwhile;?> </div>
Any help greatly appreciated
Mas
- The topic ‘Displaying a list of categories on a static php page’ is closed to new replies.