the_excerpt function not showing image
Pergunta
I am having posts with images.In single post page all contents displaying well with image. But in blog page , the content only displaying not an image.
How can i make it to display
For example, http://www.beezid.com/blog
this blog displaying images with read more link
but not in my case http://optisolbusiness.com/gonzobidz/blog/
Thanks in advance !
Solução
If you did not set an explicit excerpt for your post in the post editor, WordPress by default calls wp_trim_excerpt()
to auto-generate an excerpt. This function throws out all HTML tags to make life simple. the_content()
does not do this when it splits your post on a <!--more-->
tag.
If you don't want this default behavior you can unhook the wp_trim_excerpt()
function and duplicate it with one of your own that does not remove HTML tags. Watch out when you split your text somewhere: call force_balance_tags()
to make sure your excerpt does not end with Some <strong>great news... [Read more]
, because everything after it will be bold too. You will also have to see how this works with embedded content: if you remove some of the tags for a Flash video you also won't get what you expect.