Home › Forums › Pro Themes › Biography Pro › 3 dots after description in History section
- This topic has 3 replies, 2 voices, and was last updated 8 years ago by wensolutions.
-
AuthorPosts
-
November 8, 2016 at 3:33 pm #22850christymlopezParticipant
Hi, I have 3 dots appearing after the description of my History section items. Essentially the “body” in the page itself doesnt have any periods at the end, however when displaying its final result, it appears with 3 dots at the end. This happens to all 5 sections of my History pages
November 8, 2016 at 11:41 pm #22871wensolutionsKeymasterHello @christymlopez,
To remove the three dots displayed in the end of the text in history block you will need to create a child theme of Biography Pro theme first.
To learn more about Chile themes and manually create one you can see the link here : https://codex.wordpress.org/Child_Themes.
Alternatively, you can also use Child theme generator plugin that automates the process.
Once you have created and activated the child theme, please paste in the following custom CSS in your Child theme’s functions.php file :
function biography_words_count( $length = 25, $biography_content = null ) { $length = absint( $length ); if ( '' != $biography_content ) { $biography_content = strip_shortcodes( $biography_content ); $biography_content = str_replace( ']]>', ']]>', $biography_content ); // $biography_content = strip_tags($biography_content, wpse_allowedtags()); //Set the excerpt word count and only break after sentence is complete. $excerpt_word_count = $length; $excerpt_length = apply_filters( 'excerpt_length', $excerpt_word_count ); $tokens = array(); $excerptOutput = ''; $count = 0; // Divide the string into tokens; HTML tags, or words, followed by any whitespace preg_match_all( '/(<[^>]+>|[^<>\s]+)\s*/u', $biography_content, $tokens ); foreach ( $tokens[0] as $token ) { if ( $count >= $excerpt_word_count && preg_match('/[\,\;\?\.\!]\s*$/uS', $token ) ) { // Limit reached, continue until , ; ? . or ! occur at the end $excerptOutput .= trim( $token ); break; } // Add words to complete sentence $count++; // Append what's left of the token $excerptOutput .= $token; } $biography_content = trim( force_balance_tags( $excerptOutput ) ); return $biography_content; } return apply_filters( 'biography_words_count', $biography_content ); }
This will remove the dots displayed at the end of the content.
Hope this Helps,
Best Regards !!
November 13, 2016 at 5:57 pm #23266christymlopezParticipantHi,
So I need to recreate my entire structure that I’ve already organized into the new child theme? Once activated, it set me back to the default copy.
Please advise. I didn’t think it would require such a complicated process to remove the 3 dots.. (I am a beginner-level coder with HTML and CSS).
Thanks!
November 13, 2016 at 10:38 pm #23273wensolutionsKeymasterHello @christymlopez,
The “three dots” actually renders from the function defined within the theme.
The function takes the excerpt from your content dynamically from your chosen page / posts and adds the dots. As the “dots” comes from the function and does not have any HTML Wrapper it cannot be controlled using Simple CSS.
Also, changing HTML in the theme files is also not wise as you will lose all your changes with theme update. Thus, modifying the function via child theme implementation is the best and most efficient option for your desired output as we have suggested.
Hope this clears the confusion,
Best Regards !!
-
AuthorPosts
- You must be logged in to reply to this topic.