after I've upgraded to 2.8.9 I found a small but annoying issue with the new excerpt engine. I'm using a plugin on our website, the AddThis button, for sharing posts and pages to a variety of social sites.
I configured the AddThis plugin so that some share buttons are displayed below the actual page content.
Everything is fine when displaying the post or page with 2.8.9, the content is correctly followed by the AddThis buttons.
The problem appears when displaying archives, category views, etc. where excerpts are shown. The excerpts now contain the AddThis button, as if it was part of the page content (which it isn't, it is dynamically inserted when rendering the page). First, it looks awful, and second, it simply doesn't work. The AddThis buttons on the category page all refer to the category page they are displayed on, not to the post or page they came from.
There could have been a way to solve this. AddThis offers some options, for example I can choose on which kind of pages the AddThis button should appear (page, post, category, archive). So my first idea was to unselect category and archive. But it turned out that these settings are not respected any more. It does not matter which option I select, but I know that these settings still worked in 2.8.8.
I think excerpts should be created from the content of a particular post or page, excluding content that is dynamically inserted before or after.
Can you give me some hint or even a solution for that issue?
Any help is appreciated.
P.S.: Sorry to bother you during easter. Happy Easter!
Happy Easter too Semih!
I'm assuming you have switched the option off in General Settings? (You will probably need to re-save even if switched to disable).
Let me know if you have or haven't because there are a couple of things which are not quite saving properly for one reason or another.
i'm a little clueless. Today I sat down to do some more extensive testing and found that the AddThis options are mysteriously working again. I don't know why, because I did nothing in the meantime.
On the other hand this solves part of my problem on all the pages which use standard templates provided by your theme.
The problem remains on a single page though, and what is special about that page is that it does not use any of your blog templates but it uses the [recent_posts] shortcode to display the news excerpts:
[recent_posts content="textimage" categories="News" image_effect="shadowreflect" shadow="shadow-xsmall" image_width="50" image_height="50" image_align="alignleft" order="date" orderby="ASC" excerpt="50" limit="5" /]
I hope you can reproduce the issue with this information.
I'm sorry to have mislead you previously.
…I made some tests with your current 2.9 beta theme. The situation regarding excerpts is still the same.
I think the problem is that Advanced Excerpt gets the full content of an article and applies filters (from the content filter chain) to it thus adding AddThis code. AddThis has an option to hide when it’s called within the context of an excerpt, but Advanced Excerpt circumvents this by the way it filters the content.
I tried several approaches to solve this. The absolute minimal invasive solution I found is to change line 127 in advanced-excerpt.php to:
$text = apply_filters(‘the_excerpt’, $text);
This applies the excerpt filter chain to the text, et voilà, the AddThis option is respected again.
I think it’s not only a problem with displaying the options, the options are really not saved correctly. If I remove the separate installation of Advanced Excerpt, so that the integrated version is used again, I can not get – for example – custom excerpts to work.
P.S.: six o’clock in the morning. I need some sleep. Please forgive me in case I overlooked something, but I’d be happy if you could confirm some of my observations.
The problem with altering that line of code is that the short codes are no long processed which is how this whole excerpt situation came about. I had numerous requests for having short codes within Galleries etc so I had to change the system. If that works for you then it maybe a case of that’s what you’ll need to change for this to work.
I’ve updated the BETA again – although I never had an issue with the settings saving etc?
You must be logged in to reply to this topic.