What’s a good way to put authors into groups

To do this literally (put authors into groups) best way would probably be to create custom taxonomy for users. See custom user taxonomies in WordPress for reference. However the end result you are looking for does not really deal with grouping users – it deals with grouping posts. Registering custom taxonomy (“company”) for posts would … Read more

Order the users by the date of their latest post

Put this in your functions.php: function get_users_ordered_by_post_date($args=””) { // Prepare arguments if (is_string($args) && ” !== $args) parse_str($args, $args); $asc = (isset($args[‘order’]) && ‘ASC’ === strtoupper($args[‘order’])); unset($args[‘orderby’]); unset($args[‘order’]); // Get ALL users $users = get_users($args); $post_dates = array(); if ($users) { // For EACH user … foreach ($users as $user) { $ID = $user->ID; // … Read more

Add rewrite endpoint to author page + pagination

Your code should works. The line: include (get_template_directory_uri() . ‘/articles.php’); Needs to have allow_url_include=1 in the server configration because you are trying to include a file via http. Can you check this? You must know also that template_redirect should be use for a real redirect, a include() may have undesired effects here. I think what … Read more

the_author_posts_link css class

You can use the the_author_posts_link filter to add the custom blog-link class: /** * Add the ‘blog-link’ class to the output of the_author_posts_link() */ add_filter( ‘the_author_posts_link’, function( $link ) { return str_replace( ‘rel=”author”‘, ‘rel=”author” class=”blog-link”‘, $link ); });

Displaying custom post types in author.php

I’ll guess that you don’t set $authorid anywhere, so it’s being ignored and returning all posts regardless of author. If you enable debugging, you’ll get a warning telling you that $authorid is undefined. It’s good practice to always develop with debugging enabled, so you don’t have to guess what your errors are. Also, don’t use … Read more

Get attachment ID of author_meta image – Attachment Metadata

I suggest you to use the more newer media manager dialog; WordPress will hanlde all the image upload stuff, including generating intermediate sizes and attachement metadata. Here a working example (it is a quick example built from a previous code, it may needs some tweaks to be used on production): add_action( ‘admin_enqueue_scripts’, ‘load_wp_media_files’ ); function … Read more

If Else Gravatar Author Picture

You need to use get_the_author_meta() instead of the_author_meta() <?php $authorpic = get_the_author_meta(‘author_pic’); if ($authorpic) echo $authorpic; else echo get_avatar( get_the_author_email(), ’80’ ); ?>

Display all comments or recent comments per user on author page

your problem is using author_email, you need user_id: i just use similar script. <?php $args = array( ‘user_id’ => get_the_author_meta(‘ID’), ‘number’ => 10, // how many comments to retrieve ‘status’ => ‘approve’ ); $comments = get_comments( $args ); if ( $comments ) { $output.= “<ul>\n”; foreach ( $comments as $c ) { $output.= ‘<li>’; $output.= … Read more

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