Hello @jamescalderon,
Here is the custom code as a solution to your specific problemL
add_shortcode( 'wpdts-ddiff', 'wpdts_ddiff' );
function wpdts_ddiff( $atts ) {
$mysql = current_time( 'mysql', false );
$ts_now = strtotime( $mysql );
$atts_filtered = shortcode_atts( array(
'start' => date( 'Y-01-01', $ts_now ),
), $atts, 'wpdts-ddiff' );
$ts_diff = $ts_now - strtotime( $atts_filtered['start'] );
return intval( $ts_diff / DAY_IN_SECONDS);
}
Please place it in the functions.php file of your child theme and then just use the shortcode in the following way:
[wpdts-ddiff start="November 11, 2023"]
If you do not set the start attribute, the counting starts from the beginning of the current year (January 1).