How to change the url of the author to a specific page?
How to change the url of the author to a specific page?
How to change the url of the author to a specific page?
How to add avatar to authors list?
Sorry, but I found the answer very quickly myself and I attempted to delete this original question, but I think maybe somebody else may need this answer. This is right code to solve this issue: <h1 class=”page-title”> <?php echo ‘<a href=”‘.get_author_posts_url(get_userdata($posts[0]->post_author)->data->ID).'”>’.get_userdata($posts[0]->post_author)->data->display_name.'</a>’; ?></h1>
One option is to use the pre_get_avatar filter to return custom avatar HTML, which will short-circuit get_avatar() preventing it from reaching out to Gravatar for the image. For example like this, add_filter(‘pre_get_avatar’, ‘wpse_410434_author_img_html’, 10, 3); function wpse_410434_author_img_html( $avatar, $id_or_email, $args ) { if ( $avatar || ! is_numeric( $id_or_email ) ) { return $avatar; } … Read more
After digging through many bug reports I found a solution to the issue I was facing. The problem I was having is related to a new feature in 6.0 for sites with over 10K user accounts which automatically disables the author dropdown in Bulk/Quick edit. I’m not sure how they decided that was a good … Read more
i solve this problem by using this code <?php $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); ?> <?php the_field(‘grantor_name’, ‘user_’.$curauth->ID)
From the Codex: …when a viewer clicks on a link to a post author, by default he or she is taken to a page listing the posts from that particular author in chronological order, from newest posts at the top to oldest at the bottom. In other words, the author template is used to show … Read more
try this: add_filter( ‘the_author’, ‘feed_author’ ); function feed_author($name) { if( is_feed() && !is_admin()) { global $post; $author = get_the_terms($post->ID,’article_author’); if ( $author ) $name = the_terms($post->ID,’article_author’,”,’ & ‘); return $name; } }
before making edits, please consider to create a child theme for your customization; https://developer.wordpress.org/themes/advanced-topics/child-themes/ to show a link to the author’s page (https://developer.wordpress.org/reference/functions/get_author_posts_url/), put this code into the loop of the blog or post template file below the blog post code (please contact the theme’s developer for help with where in what file of your … Read more
Basic debugging… $current_author = get_query_var(‘author’); var_dump($current_author); … would reveal that $current_author is a string, not an object. The problem is that you are trying to use the string as an object in the query. get_posts( ‘author=”.$current_author->id.”&posts_per_page=1&order=DESC&orderby=post_date’ ); Change $current_author->id to $current_author and the query works. $author_posts = get_posts( ‘author=”.$current_author.”&posts_per_page=1&order=DESC&orderby=post_date’ );