• Resolved gtaranti

    (@gtaranti)


    Hi,

    I want to update the summary of a recipe and add a second paragraph.

    In the editor, the paragraph is shown OK, but in the front-end there is no second paragraph, as if the <br/> is missing.

    Is there a special element to mark a new paragraph in summaries?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    Can you give me a link to a recipe with this problem so I can take a look?

    Thread Starter gtaranti

    (@gtaranti)

    Sorry, the problem does not exist anymore and I can’t reproduce it.
    Now the paragraphs do split correctly.

    On another subject, what filter should I use to modify the summary text output in some specific places?
    For example, to limit the summary to only the first paragraph..

    • This reply was modified 6 years, 3 months ago by gtaranti.
    Thread Starter gtaranti

    (@gtaranti)

    I ended up using the following code to limit the summary to only the first paragraph. I’m using the text_style attribute because I can’t define a new one :

    function recipe_summary_output( $output, $attributes, $recipe ) {
    
        if (isset($attributes['text_style']) && $attributes['text_style'] == 'keep_first') {
            $text = '<div class="wprm-spacer"></div>';
            $text_pos = strpos($output, $text);
            if ($text_pos !== false) {
                return substr($output, 0, $text_pos) . '</div>';
            } else {
                return $output;
            }
        } else {
            return $output;
    }
    
    }
    add_filter( 'wprm_recipe_summary_shortcode', 'recipe_summary_output', 10, 3 );
    
    Plugin Author Brecht

    (@brechtvds)

    Happy to hear that works for you! The ability to define extra attributes is on our todo list.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Paragraph in Recipe summary’ is closed to new replies.