Jump to content

bwadamcik

New Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by bwadamcik

  1. That is my very confusion when I try and use this code above which I thought would work it does not reflect and throws an error for this line. 

     

    The only way the error doesn't occur is when I put the whole code snippet I provided in and then it reflects the whole m/d/y time. I figured that I would need to look at this to fix it and add an additional format? 

     

    Any thoughts?

     

    global $redux_demo;
    if (isset($redux_demo['events-time-format'])) {
    $time_format = $redux_demo['events-time-format'];
    if ($time_format == 1) {

  2. Hi QuickOldCar,

     

    I have no idea myself and I apologize for my sad excuse for a question. I did see the redundancy. I have a website that has the code prewritten and after inspecting it I was looking to modify a section to be more user friendly instead of listing the items by number providing the specific date event instead. I am hoping to figure out how to just remove the time portion in this code so that I can just present the date.

     

    How would it be best for me to present this question so it can be better understood?

     

    Bang

  3. Here is the code how would I go about getting only the D/M or D/M/Y

     

    <?php $event_start_date = get_post_meta(get_the_ID(), 'event_start_date', true); $event_start_time = get_post_meta(get_the_ID(), 'event_start_time', true); $event_location = get_post_meta(get_the_ID(), 'event_location', true); if(!empty($event_start_date)) { ?>
     
                                <?php
     
    global $redux_demo; 
    if(isset($redux_demo['events-date-format'])) {
    $time_format = $redux_demo['events-date-format'];
    if($time_format == 1) {
     
    ?>
     
    <?php $start_unix_time = strtotime($event_start_date); $start_date = date("m/d/Y",$start_unix_time); ?>
     
    <?php } elseif($time_format == 2) { ?>
     
    <?php $start_unix_time = strtotime($event_start_date); $start_date = date("d/m/Y",$start_unix_time); ?>
     
    <?php } } else { ?>
     
    <?php $start_unix_time = strtotime($event_start_date); $start_date = date("m/d/Y",$start_unix_time); ?>
     
    <?php } ?>
     
    <?php
     
    global $redux_demo; 
    if(isset($redux_demo['events-time-format'])) {
    $time_format = $redux_demo['events-time-format'];
    if($time_format == 1) {
     
    ?>
     
    <?php $start_time = esc_attr($event_start_time); ?>
     
    <?php } elseif($time_format == 2) { ?>
     
    <?php $start_time = date("H:i", strtotime($event_start_time)); ?>
     
    <?php } } else { ?>
     
    <?php $start_time = esc_attr($event_start_time); ?>
     
    <?php } ?>
     
           <span><?php echo esc_attr($start_date); ?> <?php echo esc_attr($start_time); ?></span>
     
                                <?php } ?>

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.