[SOLVED] [BUGFIX 3.4.1->3.4.6] Getting Configure Excerpts to work in all cases
There are two ways to have excerpts using Atahualpa (1) Add an excerpt in the post (dashboard->Posts->Edit->Excerpt) or (2) have Atahualpa create one using the first X number of words in the post (ATO->Configure EXCERPTS->Excerpt length)
When you use method (2) Atahualpa will follow the excerpt with ATO->Configure EXCERPTS->Custom read more, but with option (1) it will not. the following patch will allow the 'Custom read more' to show up in both cases. Edit functions.php and locate the following code in 3.4.1 it should be lines 243-266 in 3.4.2 it should be lines 250-273 HTML Code:
// Custom Excerpts HTML Code:
// Custom Excerpts |
Thanks for the fix ;).
|
1 Attachment(s)
I discovered a case that wasn't covered by the previous fix. In reworking it, I've discovered a bug/feature with the standard wordpress code. It all has to do with what do you count as a word? Should HTML that is embedded in a post be part of the excerpt word count? If not, why not? What about shortcodes? If not, couldn't you argue that they just shouldn't be allowed in posts at all?
What if a post has a short code and that short code generates a bunch of text, should that text be part of the wordcount or not? it gets messy. At any rate, what this change does is 1) use a manual excerpt if it exists. 2) if there is a 'teaser' use that 3) otherwise, create a excerpt based on the ATO excerpt word count - after stripping out all HTML except the things specified in 'Don't strip these tags' - but those 'words' (a word being a string seperated by a blank) count as part of the word count. i.e. the HTML not stripped will be part of the word count. This fix is for 3.4.4 1) Down load the attached file and unzip it. 2) rename your current 'functions.php', in the atahualpa folder, to 'functions_old.php' 3) copy the new 'functions.php' to your atahualpa folder that's it |
All times are GMT -6. The time now is 08:30 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.