• Hi there

    I’m using VSEL with the Advanced Custom Fields plugin and am trying to output the date from the event details and wondered what the shortcode you used is called. I can only find vsel-meta-date and that’s not worked yet.

    Any thoughts would be great.
    Thanks
    Richard

Viewing 15 replies - 1 through 15 (of 15 total)
  • 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

    Thread Starter Richard Slade

    (@raslade)

    Fantastic, i’ll have a look and see if I can get it to work.

    Richard

    Thread Starter Richard Slade

    (@raslade)

    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

    Thread Starter Richard Slade

    (@raslade)

    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

    Thread Starter Richard Slade

    (@raslade)

    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

    Thread Starter Richard Slade

    (@raslade)

    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

    • This reply was modified 6 years, 5 months ago by Richard Slade.
    Thread Starter Richard Slade

    (@raslade)

    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"

    Thread Starter Richard Slade

    (@raslade)

    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

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Shortcode used in VSEL’ is closed to new replies.