Support » Plugin: Meta Box - WordPress Custom Fields Framework » Order posts by event date

  • Hello!
    How can I order my posts by the event date?
    I have following code for my meta field:

    function event_date_get_meta_box( $meta_boxes ) {
    	$prefix = 'eventdate-';
    
    	$meta_boxes[] = array(
    		'id' => 'untitled',
    		'title' => esc_html__( 'Veranstaltungsdatum', 'event-date' ),
    		'post_types' => array( 'post' ),
    		'context' => 'advanced',
    		'priority' => 'default',
    		'autosave' => false,
    		'fields' => array(
    			array(
    				'id' => $prefix . 'event-date',
    				'type' => 'date',
    				'name' => esc_html__( 'Veranstaltungsdatum', 'event-date' ),
    			),
    		),
    	);
    
    	return $meta_boxes;
    }
    add_filter( 'rwmb_meta_boxes', 'event_date_get_meta_box' );
  • The topic ‘Order posts by event date’ is closed to new replies.