Sortable column with custom data by date

Thanks a lot to @Sally CJ for the answers. It works with changing format of start_at field and adding key in array like this : function my_sort_custom_column_query( $query ) { $orderby = $query->get( ‘orderby’ ); if ( ‘dateevent’ == $orderby ) { $meta_query = array( ‘relation’ => ‘OR’, ‘_start_at’ => array( ‘key’ => ‘_start_at’, ‘type’ … Read more

Divide the list into two columns (get_posts)

You could do this with the modulo operator. $posts = get_posts($args); $html=”<ul>”; $limit = 5; $i = 1; foreach ($posts as $post) { $html .= ‘<li>’ . $post->post_title . ‘</li>’; if($i % $limit == 0) { $html .= ‘</ul><ul>’; } $i++; } $html .= ‘</ul>’; echo $html;

create 2 custom columns in page edit in Admin panel

functions attached to manage_pages_custom_column get fired for every custom column, you have to check the name of the column within the function to only output data for that specific column: add_action( ‘manage_pages_custom_column’, ‘AddColumnValue’, 10, 2 ); function AddColumnValue( $column_name, $post_id ) { if( ‘thumbnail’ == $column_name ): echo ‘Header Image data here’; elseif( ‘cssColor’ == … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)