FancyThemes / wp-advanced-excerpt

A WordPress plugin that allows you to control the appearance of post excerpts
GNU General Public License v3.0
23 stars 7 forks source link

Incompatibility with Relevanssi #8

Closed aprea closed 10 years ago

aprea commented 10 years ago

Shame this plugin (which still works in 3.8) isn't really compatible with the Relevanssi plugin. If you want to use search hit highlighting, which relies on custom search result snippets, the plugin overwites the custom snippet thus removing the highlighting.

http://wordpress.org/support/topic/incompatibility-with-relevanssi?replies=1

aprea commented 10 years ago

These two plugins simply do not work together well at the moment.

Relevanssi wants to implement it's own custom excerpts (and has several appearance options to compliment this) as does Advanced Excerpt.

The solution I implemented allows developers to specify which page types they'd like to prevent AE from running on.

See commit here: https://github.com/deliciousbrains/wp-advanced-excerpt/commit/d6d0ade3ad6fd9f2fa232d554bf793ab6ece0383

Developers can now specify any of the following the prevent AE from running on certain page types:

single
preview
page
archive
date
year
month
day
time
author
category
tag
tax
search
feed
comment_feed
trackback
home
404
comments_popup
paged
admin
attachment
singular
robots
posts_page
post_type_archive

Code example below, prevents AE from running on search archives and author archives

function exclude_ae_excerpts( $page_types ) {
    $page_types[] = 'search';
    $page_types[] = 'author';
    return $page_types;
}
add_filter( 'advanced_excerpt_skip_page_types', 'exclude_ae_excerpts' );
aprea commented 10 years ago

Ready for testing.

bradt commented 10 years ago

Seems fine, I'm not going to bother installing Relevanssi to test this. If anyone has a problem with it, they will report it via the support forms and you can fix it. However, where are you documenting this? Maybe it should be added to the Readme FAQ?

aprea commented 10 years ago

Well, we have an easy to use UI in the form of the newly added "Disable On" checkboxes on the settings page so few people will need to use this filter.

Are we planning on a separate section to the delicious brains website for our free plugins? If so I could add some filter/action documentation there.

I don't think the documentation is going to work too well in the readme.txt. Perhaps I could add a wiki to this git and add the documentation there instead?

bradt commented 10 years ago

Sure, go for the wiki and just link to it from the README.

bradt commented 10 years ago

And no, we're not planning on adding free plugins to our site.

aprea commented 10 years ago

Wiki added.