Disabling Author Page only for subscribers

Oddly, perhaps, there is no get_user_role function, so not surprising that the earlier answer produced an error. As per my discussion with Rodney Hawk, I still wonder about the point of this exercise – or what security function this operation serves that wouldn’t be better served by other methods – but, if the preferred objective … Read more

How to limit author related post listing ?

Never, never re-query a native archive – use the pre_get_posts hook to alter the main query: add_action( ‘pre_get_posts’, function ( $wp_query ) { if ( $wp_query->is_main_query() && $wp_query->is_author() ) { $paged = max( 1, ( int ) $wp_query->get( ‘paged’ ) ); if ( $paged === 1 ) { $wp_query->set( ‘posts_per_page’, 10 ); } else { … Read more

How to hide the author box of a specific user?

If you know the data of the author, you can wrap that box with an if and the function get_the_author if( get_the_author() == “name_of_the_author” ){ // Don’t do it }else{ // Print box } EDIT with the final answer updated: <?php echo $td_mod_single->get_social_sharing_bottom();?> <?php echo $td_mod_single->get_next_prev_posts();?> <?php $user = get_user_by(“login”, “pknn”); // user object // … Read more

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