All my teaser excerpts have no formatting applied to them. With firebug I can get the text to look how I want by editing the html but I don't know where to edit the html in wordpress. How can I do this? Thanks
|
wordPress does this by default. you can either use a plugin such as: http://wordpress.org/extend/plugins/advanced-excerpt/ http://wordpress.org/extend/plugins/the-excerpt-re-reloaded/ or write your own functions to remove the default filters from the_excerpt() such as: http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/how-to-preserve-html-tags-in-wordpress-excerpt-without-a-plugin/ |
|||||||
|
|
@Michael: I wrote the tutorial you are referring to: http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/how-to-preserve-html-tags-in-wordpress-excerpt-without-a-plugin/ It does not leave any broken html tags, I use it on my blog. Unless the excerpt ends between the starting and ending tag. You need to make sure that your excerpt does not break whatever tag you are using. Check it out in the main page: http://bacsoftwareconsulting.com/blog/ @Nick: To answer the question on how to use the code of the reference above:
Copy the "MAIN_CODE" and paste it in your "functions.php" file of the thesis theme.
After that you need to replace line 22 of the "MAIN-CODE" with the "$allowed_tags" you want. For instance to allow p, a, em, strong and image, you replace Line 22: with One of the things the code can't do is to add color or larger fonts. Like I said before, you always need to make sure that the excerpt does not end in between the opening and closing tags. You can also change lines 25 and 28 to your liking. The tutorial is self explanatory, but you need to spend on it few extra minutes. Hope this Helps. Boutros. |
|||||||||
|
|
Use remove_all_filters to remove filters on the_excerpt. Have a look at wp-includes/default-filters.php - a ton of filters are added to the_excerpt and get_the_excerpt which removes most of the formatting. |
|||
|
|