acf-permalink
acf-permalink copied to clipboard
How do you use multiple date parts?
Hi,
Firstly an excellent plugin. I might be missing the obvious here, please point it out if I am.
I have an event post type, with a field event_date. I would like each event to have the permalink structure:
mysite/events/YEAR/MONTH/POST
i.e. mysite/events/2018/november/myevent
So using this plugin, in the permalinks settings I enter for the events permalink:
/%field_event_date(year)%/%field_event_date(format=F)%/%postname%/
This doesn't work, the permalink is set to:
mysite/events/2018-12-13/test-event/
It clearly has picked the date out, 13 Dec 2018. However not what I expected. doing it without the month,
/%field_event_date(year)%/%postname%/
seems to work fine and results in:
mysite/events/2018/test-event/
So question is, am I doing something wrong, or is this not possible?
Hello,
Thank you for contact.
Seems that plugin has a problem witch using the same field more that one time. I see 2 options for now:
- Use schema similar to
/%field_event_date(format=Y/F)%/%postname%/, however it results witch not exactly what you wanted, because it resultsmysite/events/YEAR-MONTH/POST(no slash between year and month). - You could use this filter and create
event_date2field dynamically (based onevent_date) and use it/%field_event_date(year)%/%field_event_date(format=F)%/%postname%/.
Fixing this issue might take some time, but here are some workarounds for now.
If you found plugin useful, you can rate it ⭐️ in Wordpress Plugin Directory :)
Piotr.