How to insert breaks (or add bullets) to the Excerpt section of a product in MarketPress

I am unable to insert breaks (
) in the Excerpt section of a Product. I tried tossing the
tag, but no love.

Here is an example:
http://mwjourney.bluepulley.com/store/products/ultimate-c/

The text reads: Advanced Vitamin C Formula* Provides 750 mg Vitamin C per Capsule* Formulated with BioPerine® to Enhance Nutrient Bioavailability*

But I'd like it to be
Advanced Vitamin C Formula*
Provides 750 mg Vitamin C per Capsule*
Formulated with BioPerine® to Enhance Nutrient Bioavailability*

It is all in a <p> tag so... ??

Access active until 2:09am in 6 days

Thanks!

  • Rupok

    Hello Mr. Wolverine, glad to see you again.

    By default, WordPress strip down all HTML markups from the excerpt input field. But normally adding the following code block in your "functions.php" allows you to use HTML tags in your excerpt:

    function wpse_allowedtags() {
        // Add custom tags to this string
            return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>,<p>,<img>,<video>,<audio>';
        }
    
    if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) : 
    
        function wpse_custom_wp_trim_excerpt($wpse_excerpt) {
        $raw_excerpt = $wpse_excerpt;
            if ( '' == $wpse_excerpt ) {
    
                $wpse_excerpt = get_the_content('');
                $wpse_excerpt = strip_shortcodes( $wpse_excerpt );
                $wpse_excerpt = apply_filters('the_content', $wpse_excerpt);
                $wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt);
                $wpse_excerpt = strip_tags($wpse_excerpt, wpse_allowedtags()); /*IF you need to allow just certain tags. Delete if all tags are allowed */
    
                //Set the excerpt word count and only break after sentence is complete.
                    $excerpt_word_count = 75;
                    $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', $wpse_excerpt, $tokens);
    
                    foreach ($tokens[0] as $token) { 
    
                        if ($count >= $excerpt_length && 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;
                    }
    
                $wpse_excerpt = trim(force_balance_tags($excerptOutput));
    
                    $excerpt_end = ' <a href="'. esc_url( get_permalink() ) . '">' . '&nbsp;&raquo;&nbsp;' . sprintf(__( 'Read more about: %s &nbsp;&raquo;', 'wpse' ), get_the_title()) . '</a>';
                    $excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end); 
    
                    //$pos = strrpos($wpse_excerpt, '</');
                    //if ($pos !== false)
                    // Inside last HTML tag
                    //$wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); /* Add read more next to last word */
                    //else
                    // After the content
                    $wpse_excerpt .= $excerpt_more; /*Add read more in new paragraph */
    
                return $wpse_excerpt;   
    
            }
            return apply_filters('wpse_custom_wp_trim_excerpt', $wpse_excerpt, $raw_excerpt);
        }
    
    endif; 
    
    remove_filter('get_the_excerpt', 'wp_trim_excerpt');
    add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');

    But it totally depends on how your theme is coded. With any standard WordPress theme, the above code block will work, but Divi is a powerful and complex theme, and I tried to make it work with Divi, it didn't work. Problems are tougher for super heroes, and you are no exception it seems.

    So can you please ask Divi developers regarding this? I believe, they can help you best regarding this. Please let us know what they say. We will be glad to help if anything is required from our end.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.