Arizona2014
Arizona2014

Reputation: 1347

WordPress category link

I am trying to create an online store from scratch, with categories and product pages. Since is my first WordPress store I'm stuck on this trivial problem which stopped me on my way. The permalinks are set to Month and name just to know the settings.

I created several categories where I want to insert the future products.

The problem arise when I try to access a certain category link - www.mysite.com/category/books/ - it displays the error page.

If I access www.mysite.com/category/ it shows me the content of the category page created in the admin panel.

All I want to do is to display all books when the visitor clicks on www.mysite.com/category/books/ and so on.

Upvotes: 0

Views: 619

Answers (2)

Arizona2014
Arizona2014

Reputation: 1347

Actually I solved it in another way, by modifying the category.php page. There I inserted this code :

$uri = $_SERVER['REQUEST_URI'];

$elms = explode('/', $uri) ;

$catName = $elms[4] ;

and it does the thing I need.

Upvotes: 0

Hex.style
Hex.style

Reputation: 91

It is simple. Go to wp-admin/options-permalink.php and make your own settings: /%category%/%postname%/

And add a prefix on the field below: category or whatever you want

Read here for more options

Upvotes: 1

Related Questions