Custom CSS based on the Author of a Post

Welcome to Stack Exchange! In your theme’s function.php, you can add this code: add_filter(‘body_class’, function($classes) { $classes[] = ‘author-‘ . get_current_user_id(); return $classes; }); This will add a CSS class with the current author’s ID to <body> which you can then target: .author-2 .widget_bt_claim_widget { display: none; } See https://developer.wordpress.org/reference/functions/get_current_user_id/ for return values.

How to create page for user?

Is there a reason why you don’t just want to make the “author archive” a page and list them all on the page with a shortcode ? If that’s an option, simply put your single author template in author.php Author templates – Template hierarchy If not, you could take your current template (that you’ve put … Read more

Get post_author email for Zapier Integration

There’s no direct way of getting the post author’s email from a post. You can get the email by using the author ID, which is present in standard WP_Post object. $post_author_id = intval( $post->post_author ); $post_author_email = get_the_author_meta(’email’, $post_author_id); Or if you just have the post ID $post_author_id = intval( get_post_field( ‘post_author’, $post_id ) ); … Read more

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