Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Tatiane Pires on "How to make URLs work for categories and tags of custom post types"

$
0
0

Searching around the support topics, I've found one with a request similar to what I need [link 1 below], but that topic is closed.

My blog posts are in Portuguese, so I created a CPT named 'postsEN', with slug 'en', for a section on my blog where I intend to write content in English.

To create a category on default posts doesn't make it, because I don't want posts in English to be listed with posts in Portuguese. I don't want another blog either, that's why I'm not going to use the network feature for this purpose.

I published a dummy 'Hello World!' post under the new CPT:
tatianepires.com.br/en/hello-world/

The links for single posts are OK. The problem is I was expecting that the following links would work too:
tatianepires.com.br/en/category/my-new-category
tatianepires.com.br/en/tag/new-tag

The category and the tag above are displayed for "Hello World!" on /wp-admin/edit.php?post_type=postsen, but the links doesn't work.

Code for register-custom-post-types.php with register_taxonomy for both 'postsen_category' (with slug 'category') and 'postsen_tag' (with slug 'tag'):
http://pastebin.com/8iRm0pSC

I'm using this file as a mu-plugin. I have already used "Save Changes" on /wp-admin/options-permalink.php to flush rewrite after upload the file to the server, but the links are not working.

What am I missing to make this code work?
I need some help to fix it. Tks.

[1] Logical permalink structure with custom post and taxonomies


Viewing all articles
Browse latest Browse all 8245

Trending Articles