Forums
Forums / Plugins / List Posts by Category
(@jakethepeg)
18 years, 11 months ago
Good morning/arvo/eve,
I would like to create a “Sitemap” of my blog.
I have created a page called “sitemap”, and have a plugin which allows me to embed php code directly into pages/posts.
Now I require the php code which will enable me to list every single post as a hyperlink, ordered by category.
For example:
Category #1 Post #1a Post #1b Category #2 Post #2a Post #2b Post #2c etc etc
I would also like to know how to exclude particular categories.
(@moshu)
http://www.dagondesign.com/articles/sitemap-generator-plugin-for-wordpress/
(@dondiego2007)
18 years, 9 months ago
mmmh, I have done all the suggested changes but it doesn’t work. may be there are different ‘polyglot’ plugins? if someone reads… tks in advance
(@manalishi)
18 years, 3 months ago
I had trouble finding the answer to this one but finally did. Here is the code to list posts by category in your sidebar:
‘<!–Show posts by category–> <?php if (in_category(‘4’)) : ?> <?php $my_query = new WP_Query(‘cat=4&showposts=15’); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php endwhile; ?>
<?php endif; ?> <!–End Show posts by category–> ‘
The topic ‘List Posts by Category’ is closed to new replies.