Tag Info

New answers tagged


try to use a new WP_Query, when you use get_posts you're using the main WP_Query this has hooks that other plugins can use to alter the query. something else i saw is that you're using include key which is not valid $my_query = new WP_Query( array( 'post__in' => array( 1633, 1634, 1635 ), 'post_status' => 'any', 'post_type' => ...


You can use wp_get_current_user() function to get current logged in user's role //Remove admin menu items if not admin function remove_admin_bar_links() { global $wp_admin_bar, $current_user; $user = wp_get_current_user(); if ( in_array( 'author', (array) $user->roles ) ) { $wp_admin_bar->remove_menu('updates'); // ...

Top 50 recent answers are included