Wordpress custom post type and permalink rewriting - wordpress

I'm struggling with a problem I'm not able too solve.
I've spent a lot of hourse in codex documentation without any luck.
I've created a custom post type called "Products". Products will be available in many language. Products permalink is something like: mysite.com/products/product-name What I need instead is something like this: mysite.com/language/products/product-name.
What I need to create the permalink? Have I to add some fancy rule with WP_Rewrite?
Is it possibile to have custom post type as page child's?
I don't really need custom taxonomy so if you know a better solution fell free to write.
Thanks for any suggestion.

You need a plugin for wordpress to gracefully handle multiple languages.
I suggest you check out wpml.org
For how the Wordpress Multilingual plugin works with custom posts types, check out their informative blog post.

Related

Parent permalink slug before CPT slug

I'm currently busy making a FAQ for my website but i'm struggling with the permalink structure.
I have made a regular page where people can see an overview of the FAQs. I called that page Klantadvies.
I installed a Custom Post Type plugin and made a post type called faq. I also made a taxonomy which is called onderwerp.
Unfortunately the plugin won't allow me to have a page parent in the slug. So i'm wondering if it's possible to have my page slug (klantadvies) in front of the custom post type slug. For example:
http://mypage.com/klantadvies/faq/onderwerp
Thnx in advance!
Rather than using a plugin for your post types and taxonomies, I'd recommend you use these two solutions:
https://generatewp.com/post-type/
https://generatewp.com/taxonomy/
You can use those to create your Post Type and Taxonomies. Within each of those configs you're allowed to setup the slugs / URL structure that you want to use.
On top of that you're going to need to setup a custom rewrite rule to handle echoing out the values you're looking for on the appropriate layout.
https://codex.wordpress.org/Rewrite_API/add_rewrite_rule

WordPress: Same Permalink structure for pages, a custom post type and a taxonomy?

Is it possible to have the same permalink structure for pages, a custom post type and a custom taxonomy. The desired permalink for them all is http://sitename.com/{slug}
How can I achieve that?
You can use plugin custom permalink. By using this plugin you can set url as u want.
http://wordpress.org/plugins/custom-permalinks/
Short answer: Yes and No. You can code something up yourself, create some fancy .htaccess rules or use a combination of plugins.
See this post, despite its name, someone does suggest a plugin - I've used the plugin they talk about (wp-no-category-base), it does the job. Be aware that you could be asking for trouble doing this (for instance if you try to label a particular post with the same name as the category/custom taxonomy/etc - read the accepted answer here: https://wordpress.stackexchange.com/questions/42120/remove-slug-in-taxonomy-url):
Remove category & tag base from WordPress url - without a plugin
I'm fairly sure it handles custom post types - can't remember. If not, check out this:
https://github.com/markoheijnen/wp-no-taxonomy-base
Note: this code has not been updated in a long time.

Creating a custom permalink structure based on post fields

I am wondering if it is possible to create a bespoke permalink structure which is based off some of the custom fields I have in my post.
The custom post fields are: film_director, film_name (these will be consitent through out the website)
So the structure I would like to create is as follows:
http://domain.com/%film_director%/%film_name%/%postname%
I'm not great with Wordpress specific terminology so I might just be looking with the wrong keywords however is this something that can be completed (with use of either a plugin or custom code)
Thanks :)
Yep you can do this : here is a nice tutorial about it : http://firecask.com/custom-fields-and-posts-in-wordpress-permalink-urls/
I also find a plugin which seems to do this, but it's quite an old one. http://wordpress.org/plugins/custom-fields-permalink/

Wordpress: Multiple Custom Post Type

After long search with no luck, finally I have decided to ask here.
I am creating WordPress theme and need to add multiple custom post type for some additional featured which I will use rapidly or can say that will be my main use for the site.
Adding single custom post type there is not problem but I want to add more than two, three or more in future. I have tried to use same code by changing register post type name but its not working and giving some error.
I would appreciate if anyone can help me to create multiple post type with multiple taxonomy and post tag for each CPT.
I will really thankful and appreciate your effort.
Try this http://wordpress.org/extend/plugins/custom-post-type-ui/
try this plugin which is very easy to use
custom post type maker

Custom Post Type Templates In Wordpress

I don't suppose anyone is aware of whether custom post types can have custom templates just like posts in WP? I've found no documentation on this on the codex and can't really find any relevant material. I'd have assumed WP 3.1 supports this but there's no mention to it. It seems like a black hole that someone must know about?
Apologies for the very generic, open-ended question. I know about custom post types and have implemented them, it's just this seems undocumented.
What do you mean by "templates"? Are you using the term in the same way WP defines it? If so, they seem to be supported: http://codex.wordpress.org/Post_Types#Custom_Types
In the form of the
single-type-template. In the same way
that posts are shown on their own page
with single.php, custom post types
will use single-{posttype}.php if it's
available.

Resources