How do I create a column in Users list and display user data from custom registration field

Use the following code to add new column and show data properly. function add_user_columns_hospital( $column ) { $column[‘hospital’] = ‘Hospital’; return $column; } add_filter( ‘manage_users_columns’, ‘add_user_columns_hospital’ ); function modify_user_table_row_hospital( $val, $column_name, $user_id ) { switch ($column_name) { case ‘hospital’ : return get_the_author_meta( ‘user_registration_hospital’, $user_id ); default: } return $val; } add_filter( ‘manage_users_custom_column’, ‘new_modify_user_table_row’, 10, 3 … Read more

Order query by meta_value with multiple custom fields

You can use meta_query to get only posts with display_submenuexpositions = true and order them by order_submenuexpositions. $args = array( ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘order_submenuexpositions’, ‘meta_query’ => array( array( ‘key’ => ‘display_submenuexpositions’, ‘value’ => ‘true’, ‘compare’ => ‘LIKE’ ) ) ); $query_posts( $args );

Display two custom values from a post

How about: $thumb = get_post_meta( $post_id, ‘thumb’, true ); $url = get_post_meta( $post_id, ‘website’, true); echo “<a href=”https://wordpress.stackexchange.com/questions/24970/$url”><img src=”$thumb” /></a>”; The get_post_meta() function is ideal when you know ahead-of-time the names of the fields you want to retrieve. Setting the third parameter to true tells it that you want to return a single value, and … Read more

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