Creating a custom permalink structure based on post fields - wordpress

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/

Related

Is it possible to create custom entities (entries if you take up the strapi vocabulary) in wordpress?

Edit : the thing I was looking for is called Custom Post Type in the WordPress World
Disclaimer: it is my first steps with WordPress and I realize I do not have the right vocabulary to make a proper google search, so please excuse me if this answer has been already asked many times ...
I'm working on a website that use an old preexisting WordPress as headless CMS.
On this new website, I need to display some "job offers"
On the preexisting WordPress, those job offers are just HTML blocks embedded in a page. So I can't get only those without having the embedded page HTML and CSS
If I could have created a custom REST API to get those "job offers", I would have said that those resources would look like this :
{
title : string,
description: string
}
My first idea would be to create a WordPress custom end point, but I do not know if it is possible to create custom entities (entries (?) If I take up the vocabulary of strapi)
Is this something that can be done?
I've tried :
basic google search
reading the strapi and wordpress documentation
I expect to be referred to a solution or to know what to search
The thing you're looking for are Custom post types if that can help a plugin called ACF can help with the custom fields.

how can i create archives for custom post type

the WordPress framework allows to build different archive templates for each of your custom post type by e.g:
archive-event.php
taxonomy-event_category.php
is it possible to create author and date archive for custom post type by doing the following:
author-event.php
date-event.php
if this is not possible, can anyone advise how i can go about achieving this?
I think these links will help answer your question and get you started:
http://codex.wordpress.org/Template_Hierarchy
http://codex.wordpress.org/Category_Templates
The gist of it is that you can in fact make an author-event.php however date-event.php does not get checked because the template hierarchy dictates that it uses date.php, archive.php, or index.php.
One solution is to use conditional tags such as is_author() or is_date(). If you do, keep in mind that you'll have to have a common archive.php and decide which template you really want to use by using conditional tags.

WordPress Custom Post Logic

I'm a newbie here, but I've been trying to understand and research this for the past couple of days to no avail.
I created a custom post type (video) with a taxonomy associated with it (industries). The taxonomy "industries" has multiple categories (I'm not sure if in this case they are called terms rather than categories; correct me if I'm wrong!) such as IT, Construction, etc. For arguments sake, let's say under the category IT there is a single post named Web Developer.
First question: With the logic above, how would I manage to reach the single post (web developer) with the URL: .../video/IT/web developer?
Second question: If on the video page I would like to display all posts in all categories, what template page should I create? Is it archive-video.php? The same question goes for the category (IT in this case): Which template page should I create in order to display all posts under a specific category?
I'll answer your second question first:
Yes, the template you should use for displaying all the custom post types would be the CPT archive, so archive-video.php sounds right.
For the categories (the exact way to say it would be "taxonomy terms" indeed), you would use taxonomy-{taxonomy}.php or even taxonomy-{taxonomy}-{term}.php if you need to get more specific.
About your first question, there is currently no core functionality to use custom taxonomies in your permalinks, but this might help you.

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.

Wordpress custom post type and permalink rewriting

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.

Resources