• Resolved sagency

    (@sdagency)


    Awesome plugin! Any way to show year only? We don’t have the month and day for each announcement.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Code Parrots

    (@codeparrots)

    Hi @sdagency,

    Yes, you certainly can just show only the year. What you want to do is filter the way the date is formatted, so when it’s output it only shows the year.

    You’ll want to drop the following small code snippet into your themes functions.php file, or into a custom MU plugin that you create.

    /**
     * The following function will alter the default date formats
     * and display just the year of the announcement
     */
    function custom_te_date_format( $date_format ) {
       $date_format = "Y"; // will output just the year
       return $date_format;
    }
    add_filter( 'timeline_express_custom_date_format' , 'custom_te_date_format' );

    Feel free to read through our documentation which also outlines the process a bit further: https://www.wp-timelineexpress.com/documentation/change-announcement-date-format/

    Thread Starter sagency

    (@sdagency)

    Thank you. I wound up checking the option to hide the date and making the year the title of the entry.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Year Only’ is closed to new replies.