• Hello,

    This is a very powerful and very easy to use plugin for displaying custom fields values.

    I have a query and I am not sure how to proceed, I have created a custom post type called Conferences
    I am using Advanced custom field to capture conference start date and end date date picker

    I want to show upcoming events on my page in a below format

    Apr 10-12 Post Title…
    May 2-3 Post Title..

    My question here is how do I Fetch the Apr from the conference start date field and show only first three characters of the month in the page?

    for this I used your short code as below
    [loop type=conferences field=date_and_time_field]
    [field conference_start_date]-[field conference_end_date]
    [field title-link]
    [/loop]

    Any Help will be Appreciated

    Thank you

    https://wordpress.org/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    You can use the date_format parameter. The syntax is a bit hard to remember (reference here).

    [field conference_start_date date_format='M j']-[field conference_end_date date_format='M j']

    The above will show: Apr 10-Apr 12. The repeating month name seems unnecessary, but if you do it like this:

    [field conference_start_date date_format='M j']-[field conference_end_date date_format='j']

    It assumes that the end date will always be in the same month as the start date. I think it would be tricky to only display the month name if the end date is in the next month.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Data Values’ is closed to new replies.