• Hi,

    I want to display a small calendar (like in dashboard, event edit page) for a specific event, by post_id (or event_id). I’m not finding the way (ajax ?).
    I’m not working with Shortcode, only functions.

    I would appreciate your help to avoid having to code from scratch with a jquery external plugin.

    Regards,

    Jacques Malgrange

Viewing 1 replies (of 1 total)
  • Thread Starter Jacques Malgrange

    (@sojahu)

    OK, I found a solution with MultiDatesPicker v1.6.3 for jQuery UI :

    <?php global $wpdb;
    $q = $wpdb->get_results("SELECT StartDate FROM ".$wpdb->prefix."eo_events WHERE post_id=".$id );
    $dates = '';
    foreach($q as $r) $dates .= "'".str_replace('-', '/', $r->StartDate)."',"; 
    $dates = substr($dates, 0, -1); ?>
    
    <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/multidatespicker/css/pepper-ginder-custom.css">
    <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/multidatespicker/js/jquery-ui-1.11.1.js"></script>
    <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/multidatespicker/jquery-ui.multidatespicker.js"></script>
    
    <div id="customCalendar"></div>
    
    <script  type="text/javascript">
    jQuery(document).ready(function(){
    	jQuery("#customCalendar").multiDatesPicker({dateFormat:'yy/mm/dd',addDates:[<?php echo $dates; ?>]});
    });
    </script>
Viewing 1 replies (of 1 total)
  • The topic ‘Display small calendar for a specific event’ is closed to new replies.