CMS & WordPress
I would like to get an excerpt of the text in my visual editor and put it into a template. What I have is a search results page and I would like excerpts of the description text to appear here. The code that I have is:
<?php echo $property['[B]i dont know the variable[/B]']; ?>
As stated above, I do not know what variable to put there. I can't use post_content because it will display everything on my page including the photos on it (as it should if using that code). I just want the description text.
I tried using post_excerpt but that appears empty on the page I need my text on because I assume something isn't being called.
Have you tried this?
<?php echo wp_trim_words( get_the_content(), 25, '...' ); ?>
25 is the number of characters to be shown.
This topic is now closed. New replies are no longer allowed.