• Resolved 1stteamllc

    (@1stteamllc)


    Hi. I’d like to use a different date format from what my WP settings reflect. Is that possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Savvas

    (@savvasha)

    Hi @1stteamllc,

    To use a different dateformat than WP settings, you will need to alter the sportspress template files and use the format you want. Just copy the template files you want to change from wp-content/plugins/sportspress/templates to wp-content/themes/your-child-theme/sportspress/ and edit them as you wish.

    Thanks,
    Savvas

    Thread Starter 1stteamllc

    (@1stteamllc)

    If I only want to change the date format on the event block calendar, where and how would I make that change?

    Plugin Contributor Savvas

    (@savvasha)

    Hi @1stteamllc,

    For event blocks, you need to modify event-blocks.php template file. At line 210 you can find the following line:

    <?php echo wp_kses_post( sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ) ); ?>

    You need to replace get_option( 'date_format' ) with your prefered date format. For example with 'Y-m-d'. As reference you can use the extended list provided at https://www.php.net/manual/en/datetime.format.php

    Thanks,
    Savvas

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Date format’ is closed to new replies.