Get_the_author doesn’t return author name
Echo it out… <?php echo get_the_author(); ?>
Echo it out… <?php echo get_the_author(); ?>
You can display author’s list by using function wp_list_authors for more info : http://codex.wordpress.org/Function_Reference/wp_list_authors And for author Template Hierarchy see below link http://codex.wordpress.org/Author_Templates
get_current_user_id(); gets the current logged in user id and you need the user whos profileUrl is views so try this insted to get the right id: $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) ); echo $author->ID;’ yep, so instead of your code try this: $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) ); if ($author->ID > … Read more
After you populate $author_array, you need to pick 6 random users out of it. Here are two straightforward choices: Shuffle the array shuffle($author_array); and pop values off of it in a for or while lopp using array_pop() Create a randomized copy of six elements of the array using array_rand($author_array,6); and then iterate through the new … Read more
Include admins in author drop-down on edit post screen
Solved. Had a custom author drop down function that causes a large query loop. add_filter(‘wp_dropdown_users’, ‘cust_dropdown_users’); function cust_dropdown_users($output) { $users = get_users(); $output = “<select id=\”post_author_override\” name=\”post_author_override\” class=\”\”>”; //Leave the admin in the list $output .= “<option value=\”1\”>Admin</option>”; foreach ($users as $user) { $sel = ($GLOBALS[‘post’]->post_author == $user->ID) ? “selected=’selected'” : ”; $output .= ‘<option … Read more
You are using ‘author’ => … twice in your code. To get the author’s ID, you should use get_the_author_meta(‘ID’) instead. So, remove the second author argument, and use this in your code: $author = get_the_author_meta(‘ID’); $args = array( ‘posts_per_page’ => $per_page, ‘author’=> $author, ‘post_type’ => ‘ultimate-auction’, //’auction-status’ => ‘expired’, ‘post_status’ => ‘publish’, ‘offset’ => $pagination, … Read more
Allow UTF-8 characters in the user slug part of URL
You may consider using this function : get_the_author_meta(‘url’) You can see here the implementation of the function get_the_author_link() and you will see how they construct the link with name.
First, you need to create an author.php file, or edit the one that your theme has, in my case, I did the test with the twentyseventeen and it doesn’t have an author.php file, so I created it. <?php /** * The template for displaying all single posts * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * * @package WordPress … Read more