how to show Author group not Author name
Edit each user via the Admin pages. Change the “Nickname” field to what you want to appear. Then use the “Display Name Publicly As” dropdown to select the nickname. Do this for each user.
Edit each user via the Admin pages. Change the “Nickname” field to what you want to appear. Then use the “Display Name Publicly As” dropdown to select the nickname. Do this for each user.
You can use this inside the WordPress loop: if (get_post_type() == ‘post’) { // do something }
You can add this pages with new rewrite rules like that : add_action(“init”, function () { add_rewrite_tag(“%specialAuthor%”, “([^&]+)”); foreach ([“personalinformation”, “settings”] as $specialAuthor) { add_rewrite_rule( “author/([^/]+)/($specialAuthor)/?$” , “index.php?author_name=\$matches[1]&specialAuthor=\$matches[2]” , “top” ); } }); add_filter(“author_template_hierarchy”, function ($templates) { $specialAuthor = get_query_var(“specialAuthor”, NULL); if (isset($specialAuthor)) { $author = get_queried_object(); $templates = [ “$specialAuthor-{$author->user_nicename}.php”, “$specialAuthor-{$author->ID}.php”, “$specialAuthor.php”, ]; } … Read more
I found a correct answer. I ended by adding custom fields (translators, reviewers …) with the ACF plugin. Example: Field Label: Translators Field Name: translators Field type: Relational (user) Field Type: multi-select .. However, this will make the table wp_postmeta very huge, as my website will contain a large number of posts.
If you use the save_post hook, every time content is published or updated, the featured image will be refreshed. Note: make sure ACF is set to return an image ID, which is not its default. add_action( ‘save_post’, ‘wpse_set_featured_image’ ); function wpse_set_featured_image($post_id) { // get author id $author_id = get_the_author_id($post_id); // get author’s image $author_image_id = … Read more
You are querying for post author with ID 8 and also you are telling to match the post type to property post type and also post_status to be either publish, acf-disabled, private. Check your post that didn’t be return for the above and will found the reason. SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND … Read more
I figured it out, completely accidentally. I had already tried the solutions posted but they did not work for me, most likely due to the theme I am using (TravelTour). For me, to get the user meta to display I had to call wp_reset_query before it. I have no idea why. Example: wp_reset_query(); // then … Read more
get_the_author_meta() get_author_posts_url() get_avatar_url() You are using all three of these functions incorrectly. Please always check the documentation first. get_the_author_meta() does not require any arguments, but you can supply the field you wish to be returned. get_author_posts_url() requires the user_id. get_author_posts_url() and this one is a bit more flexible and will take a user_id or various … Read more
I see two ways to do this: Automatically: by Matching AUTOR term name to TEAM post title Assuming the autor’s terms are the same as the custom post type team post titles, you could find the relation with code like: function show_product_autor(){ // get this woo-comm’s product author $authors = wp_get_post_terms( get_the_ID() , ‘autor’ ); … Read more
Delete Post by User