Skip Navigation

[Resolved] add line break to date

This thread is resolved. Here is a description of the problem and solution.

Problem:
add line break to date

Solution:
You can use the format attribute to get formatted date output.

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/add-line-break-to-date/#post-1100261

Relevant Documentation:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#date

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by emilyr 6 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1099751
Screen Shot 2018-09-04 at 5.39.52 PM.png

hi—

im creating a view to display my news posts and want to have a large number underneath the month in which a post was published (see image). i've looked through the wordpress codex here: https://codex.wordpress.org/Formatting_Date_and_Time but there is no information about how to separate the day from the month. how can i achieve this layout using views?

site in development is here: hidden link

thanks,
emily

#1100261

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - If you are using Types custom date field - you can use the format attribute to get formatted date output.

To display only month name:

[types field='your-field' style='text' format='F'][/types]

To display only date name:

[types field='your-field' style='text' format='d'][/types]

If you are using the post date field:
To display Month:

[wpv-post-date format="F"]

To display Day:

[wpv-post-date format="d"]
#1100698

minesh, you're brilliant... thanks for the easy fix!!