How to use Buddypress xProfile field as WordPress Bio

To just answer this question.. Hope it’s okay to pull this back up ^^ <div class=”profile-bio”> <!– Profile user info bio text –> <?php if ( $string = xprofile_get_field_data( ‘About’, get_the_author_meta(‘ID’) ) ) { echo ‘<div class=”author-about”>’; echo $string; echo ‘</div>’; } ?><!– EOF Profile user info bio text –> </div> I’m also using this, … Read more

Get last revision author, author-link and date

To get the_modified_author() we have to look in the folder wp-includes and search for the author-template.php. Line 101 shows: /** * Display the name of the author who last edited the current post, * if the author’s ID is available. * * @since 2.8.0 * * @see get_the_author() */ function the_modified_author() { echo get_the_modified_author(); } … Read more

How to remove the dropdown author data from the post edit page

An easy sulotion will be to remove the post type author feature. add_action( ‘init’, ‘remove_cpt_author’ ); function remove_cpt_author() { remove_post_type_support(‘post’, ‘author’); // this function require the post type and the feature you want to remove. }

Filter Author Bio

You can use the filters the_author_$meta and get_the_author_$meta (where $meta is in this case ‘description’): add_filter(‘the_author_decription’, ‘custom_about_member’, 10, 2); add_filter(‘get_the_author_decription’, ‘custom_about_member’, 10, 2); function custom_about_member($description, $userid) { $about = get_user_meta($userid, ‘user_about’, true); if ($about) {return $about;} return $description; } This of course relies on the place where the author bio is being displayed using the … Read more

How can I get the author description’s excerpt?

There is none. You have to implement your own custom function to trim any content you wish. For example, this function will trim your content based on words: function my_custom_excerpt ( $content, $limit = 20, $more=”…” ){ return $data = wp_trim_words( strip_tags( $content ), $limit, $more ); } Or this one will trim it based … Read more

How to update author display name on blog posts based on user role

The main culprit is this line $current_user = wp_get_current_user(); As the name “get current user” suggests, it gets you the currently logged in user. That is not what you want. Being in the the_author filter, you can use the global $authordata variable, as the function calling the filter relies on it as well. function add_verification_bagdge_to_authors($display_name) … Read more

Author website URL

you need to assign $curauth and since you are not on an author archive but on a regular page you can use get_userdata function and pass the user ID like so: $curauth = get_userdata(1); //and then use echo $curauth->user_url; or if you are in the loop you can use the_author_link(); which will Displays the author’s … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)