[PHP] Creazione countdown a 72 ore

Michaelweb93

Nuovo Utente
29 Giu 2017
18
0
1
32
Ciao a tutti,
vorrei creare il mio countdown a 72 ore all'interno del mio sito web.
Di seguito potete vedere il codice che ho nel functions.php.
Cosa devo fare?

add_action( 'wp_footer', 'prolist_woocommerce_photoswipe' );

function prolist_woocommerce_countdown() {
$seconds = 1 * 7 * 24 * 60 * 60;
?>
<div>
<h1><?php esc_html_e('The offer expires between:', 'prolist'); ?></h1>
<span id="cd_h">00</span>
<span>Hours</span>:
<span id="cd_m">00</span>
<span>Minutes</span>:
<span id="cd_s">00</span>
<span>Seconds</span>:
<span id="cd_ms">00</span>
<span>Thousandth seconds</span>
<br/>
<br/>
<button type="button" id="cd_start" class="btn"><?php esc_html_e('Start', 'prolist'); ?></button>
<button type="button" id="cd_pause" class="btn"><?php esc_html_e('Pause', 'prolist'); ?></button>
<button type="button" id="cd_stop" class="btn"><?php esc_html_e('Stop', 'prolist'); ?></button>
<button type="button" id="cd_reset" class="btn"><?php esc_html_e('Reset', 'prolist'); ?></button>
<input type="hidden" value="<?php echo $seconds; ?>" id="cd_seconds" />
<span id="cd_status" class="hidden"></span>
</div>

<?php
}
add_action('woocommerce_single_product_summary','prolist_woocommerce_countdown',21);


Grazi a chi mi risponde.
 
Stai utilizzando Wordpress a quanto vedo.
Ci sono molti plugin personalizzabili per avere questa funzione.
 

Discussioni simili