Mai Date [mai_date] Shortcode

Display a post date on archives, single posts, or in Mai Post Grid block. This shortcode includes powerful attributes for displaying published and/or updated dates.

Here is an overview of how to use shortcodes.

published

Shows the published date.

Default is true.

Example:

[mai_date published="true"]

updated

Shows the updated date.

Default is true.

Example:

[mai_date updated="true"]

updated_min

Only shows the updated date if it is this long after the published date. Accepts any readable value that strtotime() accepts.

Default is 60 days.

Example:

[mai_date updated_min="30 days"]
[mai_date updated_min="4 weeks"]

updated_only

If the updated date will be shown based on the updated_min condition above, setting this parameter to true will hide the published date so only the updated date is shown.

Default is false.

Example:

[mai_date updated_only="true"]

before

Show content before the published date.

Default is empty.

Example:

[mai_date before="Published on "]

after

Show content after the published date.

Default is empty.

Example:

[mai_date before="(" after=")"]

before_updated

Show content before the updated date. This will only display if the updated date is displayed based on the updated_min condition.

Default is Updated or (Updated depending on updated_min .

Example:

[mai_date before_updated="Updated: "]

after_updated

Show content after the updated date. This will only display if the updated date is displayed based on the updated_min condition.

Default is empty or ) depending on updated_min .

Example:

[mai_date before_updated="(Updated: " after_updated=")"]

format

Change the published date format. Default uses the setting from Dashboard > Settings > General (Date Format).

[mai_date format="M j, Y"]

updated_format

Change the updated date format. Default uses the setting from Dashboard > Settings > General (Date Format).

[mai_date updated_format="M j, Y"]

relative

Shows published and/or update date relative to the current time. Example: "2 days ago" or "3 hours ago".

[mai_date relative="true"]

relative_max

The amount of time to show the relative time, after a post is published.

[mai_date relative="true" relative_max="7 days"]
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us