Can I Include author login in post class?

Yes, you can do it pretty easily using get_the_author_meta function and post_class filter: function add_author_nicename_to_post_class( $classes, $class, $post_id ) { $classes[] = get_the_author_meta( ‘user_nicename’ ); return $classes; } add_filter( ‘post_class’, ‘add_author_nicename_to_post_class’, 10, 3 );

author_link filter not work correctly

The problem is that while you can change the URL, you also need to make sure WordPress knows what to do with it. This is called the Rewrite API. There’s a filter specifically for author URLs. If we print that, it looks like this: Array ( [author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2] [author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2] [author/([^/]+)/embed/?$] => index.php?author_name=$matches[1]&embed=true …

Read more

how to get page views of author page?

WordPress doesn’t track page views, so this isn’t possible. You would need to use a plugin or (preferably) an external analytics service to track views. The method of checking views for an author page would then depend on that plugin or service.

author slug in the backend

Please read the codex on this function. Outside of the loop, your second arg must be a user ID. Inside the loop, WP grabs it from the post data. get_the_author_meta(‘user_nicename’, $userID);

get_the_author_meta not working

In the “homepage” code you posted, you have get_the_author_meta commented out. <?php /*?><img src=”<?php echo esc_attr( get_the_author_meta(“author_pic_sidebar’, $user->ID ) ); ?>” alt=”” /><?php */?> That is why it doesn’t work. See that <php /*?> right at the beginning of the line?

Author’s Id from wp list authors function

You can use the following: // prepare arguments $args = array( // search only for Authors role ‘role’ => ‘Author’, // order results by display_name ‘orderby’ => ‘display_name’ ); // Create the WP_User_Query object $wp_user_query = new WP_User_Query($args); // Get the results $authors = $wp_user_query->get_results(); // Check for results if (!empty($authors)) { echo ‘<ul>’; // …

Read more

Create an Author Page on Registration

Interesting question, though I have to say it’d be way easier to solve this with a membership plugin – I assume you don’t want that. I have found this plugin which hasn’t been updated for over 2 years, however the author.php template hasn’t changed much since then. The only way to do this is either …

Read more

Get all media files for current author

Media are just posts – so just query posts. This is untested: $args = array( ‘author’ => $author_id, ‘post_type’ => ‘attachment’, ); $query = new WP_Query( $args ); I’m not sure if you want currently logged in user or the author of the post currently in the loop – either way you can set $author_id …

Read more