Hello,
Great plugin.
I have what I think is relatively simple problem. I have tried using a plugin for this (https://github.com/athlan/wordpress-custom-fields-permalink-plugin) but this seems to mess with my home page, changing it from a static back to the blog.
I have also tried adapting code from here http://firecask.com/custom-fields-and-posts-in-wordpress-permalink-urls/ and here also https://wordpress.org/support/topic/adding-a-custom-field-in-addition-to-post-name-to-permalinks?replies=22 with no luck.
Here’s my problem:
I have created a custom post type (using Custom Post UI) with the name ‘Holidays’. And I have created a custom field (using ACF) for Holidays with the name Holiday code (holiday_code).
I would like the custom field (holiday_code) to show in the custom post permalink like this http://gotimetrekkers.com/holiday/holiday_code/name_of_holiday/
It’s now four hours on this, so any help very much appreciated!
Cheers
p
Hi,
This is not really what custom fields are for.
I would suggest that instead of using a custom field you can create your own taxonomy (also possible with Custom Post Type UI) which will be the Holiday code.
Then in your permalink-settings make sure you have a custom structure of
/%category%/%postname%/
That’ll lead to the permalink-structure you’re looking for and also let you have archives of holidays within a specific holiday code. Win win.
A bonus is that this permalink-structure is recommended as the best for SEO.
Thanks…Looks like this might be the way to go. The only reason I didn’t want to do this was that I’ll end up having a separate category for each holiday, and also I wanted the Holiday code to be ‘required’ – not sure if I can do this with categories.
Good for SEO is a definite plus though!
Cheers
p