-
AuthorPosts
-
April 25, 2017 at 8:29 pm #783081
Currently on my site, if you visit an author page where the user hasn’t entered a bio, you see this:
About Adam Bourne
This author has yet to write their bio.
Meanwhile lets just say that we are proud Adam Bourne contributed a whooping 0 entries.(Link to page here: https://louisianabaptists.org/author/adam-bourne/)
Most of our users don’t actually contribute content to the site, and with that last line worded the way it is, it looks really sarcastic. I’d like to either delete that line or change the wording if possible.
Where would I find that?
April 26, 2017 at 1:38 pm #783459Hey lbccomm,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css or you child theme styles.css
.author_description_text { display: none; } .author_description h3 { line-height: 4em; margin-bottom: 0px; }
If you need further assistance please let us know.
Best regards,
VictoriaApril 26, 2017 at 9:36 pm #783697Thanks for the response. However, that isn’t the result I was looking for. I don’t want to remove the bio altogether. If they have written a bio, I still want it to display. I just don’t want it to say exactly what it currently says if the user hasn’t submitted a bio. Is there a way to change what it says?
April 27, 2017 at 3:48 pm #784078Hi,
Please add following code to Functions.php file in Appearance > Editor and change the text as needed
add_filter('avf_author_description','av_new_avf_author_description'); function av_new_avf_author_description(){ $author_id = get_query_var( 'author' ); if(empty($author_id)) $author_id = get_the_author_meta('ID'); $name = apply_filters('avf_author_name', get_the_author_meta('display_name', $author_id), $author_id); $description = __("This author has yet to write their bio.",'avia_framework'); $description .= '</br>'.sprintf( __( 'Meanwhile lets just say that we are proud %s contributed a whooping %s entries.', 'avia_framework' ), $name, count_user_posts( $author_id ) ); if(current_user_can('edit_users') || get_current_user_id() == $author_id) { $description .= "</br><a href='".admin_url( 'profile.php?user_id=' . $author_id )."'>".__( 'Edit the profile description here.', 'avia_framework' )."</a>"; } return $description; }
Best regards,
YigitApril 27, 2017 at 10:42 pm #784240I appreciate the code. It let me remove the line I wanted to delete. However, it is overriding all bios. There are some users who have submitted a bio and they’re being overridden now. Is there a way to point the code specifically to users without a bio?
April 27, 2017 at 11:14 pm #784249Hi,
My bad, please change the code to following one
add_filter('avf_author_description','av_new_avf_author_description'); function av_new_avf_author_description(){ global $avia_config; $author_id = get_query_var( 'author' ); if(empty($author_id)) $author_id = get_the_author_meta('ID'); $name = apply_filters('avf_author_name', get_the_author_meta('display_name', $author_id), $author_id); $email = apply_filters('avf_author_email', get_the_author_meta('email', $author_id), $author_id); $gravatar_alt = esc_html($name); $gravatar = get_avatar($email, '81', '', $gravatar_alt); $name = "<span class='author-box-name' ".avia_markup_helper(array('context' => 'author_name','echo'=>false)).">". $name ."</span>"; $heading = __("About",'avia_framework') ." ". $name; $description = get_the_author_meta('description', $author_id); echo '<section class="author-box" '.avia_markup_helper(array('context' => 'author','echo'=>false)).'>'; if(empty($description)) { $description = __("This author has yet to write their bio.",'avia_framework'); $description .= '</br>'.sprintf( __( 'Meanwhile lets just say that we are proud %s TESTING HERE %s entries.', 'avia_framework' ), $name, count_user_posts( $author_id ) ); if(current_user_can('edit_users') || get_current_user_id() == $author_id) { $description .= "</br><a href='".admin_url( 'profile.php?user_id=' . $author_id )."'>".__( 'Edit the profile description here.', 'avia_framework' )."</a>"; } } return $description; }
Best regards,
YigitApril 28, 2017 at 3:47 pm #784651That worked like a charm! Thank you very much.
April 28, 2017 at 3:54 pm #784654Hey!
You are welcome!
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Enjoy your weekend :)
Best regards,
Yigit -
AuthorPosts
- The topic ‘Change automated user bio’ is closed to new replies.