• taro0904

    (@taro0904)


    Hello,

    hope someboy could help me ?
    I would like to sort the following table by date of the 1. column “$beginn”. The dates in the database are stored in timestamp. And if possible it sould only show future dates up today. What do I have to add to my code ?

    // check if the repeater field has rows of data
    if ( have_rows('t_block') ) {
    
     	// loop through the rows of data
        while ( have_rows('t_block') ) : the_row();
    
    		 $beginn= get_sub_field('beginn');
    		$ende= get_sub_field('ende');
    		$preis= get_sub_field('preis');  
    
            // display a sub field value       
    
               echo "<tr><td>" . $beginn . '</td>';
               echo "<td>" . $ende . '</td>';
               echo  "<td><a href='" . get_the_permalink() . "' />" . get_the_title() ."</a></td>" ;
              echo "<td>" . $preis . '</td></tr>';
    
          /*
          */
        endwhile;
    
    } else
    {
    
        // no rows found
    
    }

    Thank you for your help !!
    https://wordpress.org/plugins/advanced-custom-fields/

The topic ‘Sort by date colum’ is closed to new replies.