Plugin Author
Guido
(@guido07111975)
Hi Richard,
Guess you display the ACF fields like this:
<?php the_field('text_field'); ?>
In that case you can display dates like this (not tested yet):
<?php the_field('event_start_date'); ?>
<?php the_field('event_end_date'); ?>
Note: my plugin uses 2 date field, start-date and end-date!
Guido
Plugin Author
Guido
(@guido07111975)
Or get the field value directly from DB (also not tested because I don’t have ACF installed.. yet):
<?php the_field('event-start-date'); ?>
<?php the_field('event-date'); ?>
Guido
Fantastic, i’ll have a look and see if I can get it to work.
Richard
An update on this query. I’ve managed to output the event start date and with an event that starts 08-04-2019 the date that gets output displays as 1554681600
Very weird?
Richard
Plugin Author
Guido
(@guido07111975)
Ah of course.. that’s the raw PHP date!
Try this (you might have to change the date value into the correct one):
<?php date_i18n( the_field('event-start-date') ); ?>
<?php date_i18n( the_field('event-date') ); ?>
Source here.
Guido
Ok thanks. Only problem is i’m not outputting the dates through the theme templates but instead through shortcodes inserted into the Posts Table Pro plugin.
Plugin Author
Guido
(@guido07111975)
Sorry, no idea. Guess you should ask the developer of Posts Table Pro for support. It’s a premium plugin, so I don’t have access to it.
Guido
Ok thanks i’ve asked the plugin developer.
Another question related to this: I’ve tried adding vsel_cats to my shortcode to output the category but nothing is happening?
Richard
Plugin Author
Guido
(@guido07111975)
Hi Richard,
It should work, did you use the cat slug?
Example: event_cat="category-slug"
Guido
Hiya
I’m trying to output all the category names to appear in my table and the shortcode won’t accept apostrophes in the field, it requires just the ACF name.
Richard
Ok sorted. The Posts Table Pro sees event_cat as a custom taxonomy rather than an Advanced Custom Field.
Plugin Author
Guido
(@guido07111975)
Hi,
You mean it doesn’t work? And if you define the post type as well?
post_type="event"
Nope it works now with defining event_cat as a custom taxonomy. Now just need to fix the raw php date.
Plugin Author
Guido
(@guido07111975)
Maybe this reply helps you with that.
Guido
Plugin Author
Guido
(@guido07111975)
Hi @raslade / Richard,
Are you using a page builder to get the ACF fields in your page/post/event template? In that case I would like to know how you’ve fixed the display of raw date.
Guido