Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you use multiple date parts? #13

Open
drnickyoung opened this issue Nov 25, 2018 · 1 comment
Open

How do you use multiple date parts? #13

drnickyoung opened this issue Nov 25, 2018 · 1 comment

Comments

@drnickyoung
Copy link

drnickyoung commented Nov 25, 2018

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?

@athlan
Copy link
Owner

athlan commented Nov 25, 2018

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:

  1. Use schema similar to /%field_event_date(format=Y/F)%/%postname%/, however it results witch not exactly what you wanted, because it results mysite/events/YEAR-MONTH/POST (no slash between year and month).
  2. You could use this filter and create event_date2 field dynamically (based on event_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants