I need to maintain some formatting in the post excerpt for this site. I followed the instructions here
https://toolset.com/forums/topic/maintain-formatting-in-post-excerpt-field/#post-360326
but this is pretty old and seems to no longer work.
Should it or is there a more current solution i could try
Thnaks
This shortcode still works to some extent, but I haven't tested it thoroughly. I tested with some paragraph tags in text content, and those are maintained as expected. What is the exact content in your post excerpt, and where have you placed the get-excerpt shortcode? What is the output on the front-end of the site?
Christian thanks. I get no output at all from the short code. Im using it in a simple view like this
<wpv-loop>
<div class="one-half post-excerpt" id="[wpv-post-title]">
[wpv-post-featured-image size="large"]
<div class="post-excerpt-content">
<span class="post_date">[wpv-post-date]</span>
<h3> [wpv-post-title output="sanitize"]</h3>
[get-excerpt post_id = "[wpv-post-id]"]
<br/>
Read More >
</div>
</div>
</wpv-loop>
And the formatting im losing is just and a <br /> So nothing to complex.
Oh am i misunderstanding how this works. Does this work to create an excerpt from te main content- or just allow formatting on an explicitly entered excerpt?
As I understand it, this custom shortcode is only for explicitly entered excerpts because it reads the excerpt information directly from a post object from get_post. If no excerpt is explicitly provided in the post editor, the post_excerpt information returned by get_post will be blank for this post.
Thanks Christian- I'll use that function and short code and go through and hand craft excerpts. Appreciate the clearification