answered question
0
Votes
Votes
2
Answers
Answers
M$2.00
How can I add lines between paragraphs in Wordpress excerpt section?
When I type out in the excerpt in the wordpress admin section they all just show up together in one huge long paragraph in the latest posts section.
How can I make it so that the excerpts show up the way I write it?
for example,
If I write:
“Hi there!
How can I add lines between paragraphs?”
It shows up as:
“Hi there!How can I add lines between paragraphs?”
When I remove the strip tags from the code in home.php, the excerpt is compeletely lost.
Can anyone help me out on this problem?
How can I make it so that the excerpts show up the way I write it?
for example,
If I write:
“Hi there!
How can I add lines between paragraphs?”
It shows up as:
“Hi there!How can I add lines between paragraphs?”
When I remove the strip tags from the code in home.php, the excerpt is compeletely lost.
Can anyone help me out on this problem?
|
Report
answers (2)
Please note: if the following answer is not clear - see the attach image. It looks like Mahalo also uses "strip_tags" in the answer form. The "strip_tags()" function strips a string from HTML, XML, and PHP tags. http://www.w3schools.com/php/func_string_strip_tags.asp Basically, if you put a /br/ tag strip_tags() would remove it. In the example from the above link: echo strip_tags("Hello world!"); ?> Because of the strip_tags, the text is displayed as Hello World in plain text (instead of bold). I managed to download and analyze your template and found the line you were referring to: "-- strip_tags(get_the_excerpt(), ''); ?> --" The above code means, it would strip everything but the and tags. To ensure that the is not being 'stripped' just add it to the exception list in between the ' ' Try this code instead: '); ?> Please note, after ' I have added . You might also need to add too - just in case it doesn't work. Basically, this code '); ?> means "strip all HTML tags but "
| Asker's rating: |
Hi thef1blogger,
Are you making sure to add a line break tag in the code?
example:
“Hi there!< br >
How can I add lines between paragraphs?”
http://www.w3schools.com/TAGS/tag_br.asp
Are you making sure to add a line break tag in the code?
example:
“Hi there!< br >
How can I add lines between paragraphs?”
http://www.w3schools.com/TAGS/tag_br.asp
Thank you for your answer,
I tried everything including your solution but it doesn't work.
I think it may be related to the wordpress theme that I'm using.
I found below line in my theme's home.php file and I think removing strip tags may solve my problem but I just don't know how to remove it. When I remove the line completely I lost the excerpt at my homepage too.
?php echo strip_tags(get_the_excerpt(), ''); ?>
you can check my website to get a clear picture;
www.thef1blogger.com
I tried everything including your solution but it doesn't work.
I think it may be related to the wordpress theme that I'm using.
I found below line in my theme's home.php file and I think removing strip tags may solve my problem but I just don't know how to remove it. When I remove the line completely I lost the excerpt at my homepage too.
?php echo strip_tags(get_the_excerpt(), ''); ?>
you can check my website to get a clear picture;
www.thef1blogger.com
Hmm well here are some things you might want to check out:
http://codex.wordpress.org/Template_Tags/the_excerpt
and you might have some luck with this plugin http://wordpress.org/extend/plugins/advanced-excerpt/
http://codex.wordpress.org/Template_Tags/the_excerpt
and you might have some luck with this plugin http://wordpress.org/extend/plugins/advanced-excerpt/
Related questions
140 characters left














with no luck.
and boom! it's working..Then I tried to replace it with only p>
BTW, I didn't type "<" before the codes because it doesn't show anything in that case!
Please refer to the screenshot for my reply;