I'm doing a Wordpress blog. The blog page has a submenu in which appear the categories of the posts and the idea is, when I click in one category, it displays the posts that are of that category.

So the problem is, I have to create a new page and pass url parameters to know which category was selected? What is the best way to do this?

2 Answers 2


Normally the category url is www.homepage.com/category/slug-of-the-category/. You can find all categories and their url under Posts -> Categories in the backend of WordPress. So you don't have to create a page, because the pages already exist.


Using the function <?php echo get_category_link( $category_id ); ?> I can access to the category pages of the blog.


Retrieve category link URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.