Show different badge based upon the user role

You can use get_queried_object to get data in the current author page: <?php $author = get_queried_object(); // uncomment next line to see all author data // print_r( $author ); if( in_array( ‘author’, $author->roles ) ) : echo “author”; elseif( in_array( ‘subscriber’, $author->roles ) ) : echo “subscriber”; endif;

Just wanted to Pull Author’s Link

If the_author_meta is already working for you, you should be able to use get_the_author_meta(‘ID’) to pass with the get_author_posts_url(); So, like this: <a href=”https://wordpress.stackexchange.com/questions/269316/<?php echo get_author_posts_url( get_the_author_meta(“ID’) ); ?>”>Read More</a> Let me know if that works for you!

Allow Content Author to Publish, But Not Edit or Delete

I would create a new user role, and then assign that role to the user when you create their account. In your functions.php: add_role(‘content_writer’, ‘Content Writer’, array( ‘read’ => true, ‘publish_posts’ => true, ‘edit_posts’ => false, ‘delete_posts’ => false, )); You can see the codex for an additional listing of available roles and capabilities.

How to get posts without author?

That won’t be as easy as you’d like to… get_posts uses WP_Query to get posts and if you take a look at WP_Query code, ten you’ll see, that 0 is used as empty in there (https://core.trac.wordpress.org/browser/tags/5.0.3/src/wp-includes/class-wp-query.php#L2052): if ( ! empty( $q[‘author’] ) && $q[‘author’] != ‘0’ ) { It means, that you can’t pass ‘author’ … Read more

Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?

Now I’ve understand the question, and yes, it makes sense. The filter additions and the third function do not change at all, what change are the first two functions. There is 2 cases: [AuthorName] part in the url is equivalent sanitize_title($guestauthor) where $guestauthor is what is saved in the ‘guest-author’ custom field [AuthorName] part is … Read more

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