Ali Raza
Ali Raza

Reputation: 1131

how to show different post of different category on different pages in wordpress?

I am working with wordpress theme , I want to show posts on different pages according to category .

for example page name is "Blog" and post category is postBlog, can you tell me how I can use post according to category .

Thanks

Upvotes: 0

Views: 1780

Answers (3)

Rick
Rick

Reputation: 114

I think people get confused trying to use Pages when they are actually better off using Categories. If you want to have blog posts show up on different URLs or 'pages' then all you have to do is set up your categories and put those categories into you Menu. Then when you post make sure to select which categories you want that post to show on. You don't have to use pages at all. Pages are better for static content.

Good luck, I hope this helps.

Upvotes: 0

Leonardo Barbosa
Leonardo Barbosa

Reputation: 1396

What are you trying to do can be achieved with WordPress Category Template.

From the Codex:

For instance, when a viewer clicks on a link to one of the Categories on your site, he or she is taken to a page listing the Posts from that particular Category in chronological order, from newest Posts at the top to oldest at the bottom.

You can create a file in your theme, called: category.php, put a loop inside of it and then WordPress will automatically do that for you.

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

And then fill your needs with the page. You can check the documentation for The Loop here in this link.

Upvotes: 1

ggdx
ggdx

Reputation: 3064

create a template category-catname.php or category-catID.php in your theme dir.

See http://codex.wordpress.org/Category_Templates

Upvotes: 0

Related Questions