Query filter on custom post by current author in post widget for elementor query id
Query filter on custom post by current author in post widget for elementor query id
Query filter on custom post by current author in post widget for elementor query id
Custom fields don’t have an archive template so you may wish to consider using a custom taxnomy, where the terms are the names of your guest authors. I think this is quicker and easier than messing around with custom templates on pages, less code wrangling and complexity. Naturally if you have lots of posts with … Read more
Change get_author_posts_url / Author URL via filter
How to make the Post Author name fixed as “Editorial Staff” even if there are multiple authors?
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>
Assign new post author IF another user in custom field on post transition
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)
Assuming that you have an array of post objects in $my_posts… $authids = array_unique(wp_list_pluck($my_posts,’post_author’)); What you will get are the post authors for the current page of posts, not the post authors for all of the posts. If you want the authors for all of the posts you will have run another query. To run … Read more