• Resolved eligence

    (@eligence)


    When getting the term description the paragraphs that have been added by hitting “return” in the wysiwyg are not included. I would expect them to be as this is how it works for posts and pages.

    • This topic was modified 5 years, 5 months ago by eligence.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Can I ask which method you are using to obtain the term description?

    Thread Starter eligence

    (@eligence)

    In taxonomy-{slug}.php

    global $wp_query;
    $term = $wp_query->get_queried_object();

    then

    <?php echo $term->description; ?>

    • This reply was modified 5 years, 5 months ago by eligence.
    Thread Starter eligence

    (@eligence)

    Apparently that strips the <br>. Solution below for those who come looking. Didn’t find it the last time I tried. Thanks Shea.

    solution: term_description($term->term_id)
    https://wordpress.stackexchange.com/a/256020/99080

    Plugin Author Shea Bunge

    (@bungeshea)

    Yes, good catch. $term->description will return the raw term description text, without any of the usual WordPress text formatting functions applied.

    The term_description() function will retrieve the description with proper formatting.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No Paragraphs in $term->description’ is closed to new replies.