Recent Posts Shortcode Formatting

Support Forums for LiveMesh Themes & Plugins Forums Extinct Theme Support Recent Posts Shortcode Formatting

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
  • #13006

    Hi- Great theme, very easy to use so far. I really appreciate all of the attention to detail you paid on the styles of everything—looks really nice.

    I’m using the Recent Posts shortcode to create a page of product specials and it’s working great, except the formatting seems to get stripped when it’s output to the page:

    It’s crunching everything into one paragraph and not including the linebreaks of the post. Is there a way to prevent that from happening?




    You require a little bit of code to be written to achieve this since WordPress does not allow tags in excerpt by default. Pls have a look at this post –

    Pls let me know if you need more information. Also, you will need to change framework/functions/post-functions.php line number 372 to –

    $excerpt_text = mo_truncate_string(get_the_excerpt(), $excerpt_count, false);

    Actually, now that I rethink it, it’s allowing some formatting in the excerpts already, but it’s not breaking paragraphs. When I add a <br /> tag it breaks, but the standard WP breaks are being stripped it seems.


    If the standards break tags are being used, I would stick with them instead of messing with filters which would affect excerpts everywhere.


    I get what you’re saying but, I’m not worried about the risk. I’d rather use a filter than have to teach my client how to use <br /> tags.


    So, from what I can tell after looking into this, wpautop is active by default in post excerpts. But in Extinct, it is disabled in the recent posts shortcode excerpt. Can you tell me where I can re-enable that? I’ve been looking and can’t seem to figure out where that is.



    As of our knowledge we haven’t deactivated the p tag, WordPress itself is modifying.

    Can you pls try this Advanced Excerpt plugin –
    Hope this will help your work.


    I’ve installed the plugin and tried several different combinations of settings and it didn’t help.

    The strange thing is, I can only find filters to disable the wpautop function, as if it’s the default in WordPress, so it’s confusing that WordPress is modifying it on its own and it’s now disabled. A search on Google tells me several ways to disable it, but not how to enable it.


    What about having the shortcode call the_content instead of the_excerpt? Can you tell me where I could do that?


    Sorry to hear you are still facing this issue. To try get_the_content(), I guess it would be same place as get_the_excerpt function call in framework/functions/post-functions.php line number 372.


    Tried that, it’s still stripping the <p> tags and mashing the content together.

    I tried adding the filter below to the functions.php file, but that didn’t help either.

    add_filter( 'get_the_content', 'wpautop' );

    I appreciate your assistance… This is the last thing I need to adjust on this site before it’s done and it’s driving me up the wall!


    This also works and is a little cleaner:


    $output .= get_the_content();


    $output .= apply_filters( 'the_content', get_the_content() );


    Glad you were able to get this working. Thanks for letting us know about your findings.

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Recent Posts Shortcode Formatting’ is closed to new replies.