0

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?

1

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.

|improve this answer|||||
0

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

https://developer.wordpress.org/reference/functions/get_category_link/

Retrieve category link URL.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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