Continue reading 10Web Photo Gallery

10Web Photo Gallery

The Photo Gallery plugin from 10Web uses a shortcode to add photo galleries to posts and pages. By default, Relevanssi doesn’t index the gallery contents. Photo Galler only registers the shortcode in the front end, so when Relevanssi indexes pages in the admin context, Relevanssi only sees the shortcode, not the gallery contents. To fix…

Read more 10Web Photo Gallery 0 Comment on 10Web Photo Gallery
Continue reading Premium 2.19 / Free 4.17

Premium 2.19 / Free 4.17

…Minor fix: If the sentence query variable is used to enable phrase searching, Relevanssi now adds quotes to the highlight parameter. Minor fix: Add support for TablePress table_filter shortcodes. Minor fix: Improve WP File Download file content indexing support. Relevanssi indexing now happens after the WPFD indexing is done. Premium….

Read more Premium 2.19 / Free 4.17 0 Comment on Premium 2.19 / Free 4.17
Continue reading Search form: Search only in titles

Search form: Search only in titles

If you want to add an option to search only in titles to your search form, here’s how. First, you need to modify the search form to add the selection. To add a simple dropdown, add this to your search form: This select element will create a small dropdown with the option to search everything…

Read more Search form: Search only in titles 0 Comment on Search form: Search only in titles
Continue reading Integrating Koko Analytics stats

Integrating Koko Analytics stats

…example, I have Kirjavinkit, a book review site with an archive of about 10,000 book review posts. The popularity of the posts is primarily driven by external search traffic and seems like a good indicator of what users find interesting and valuable. Integrating the Koko stats as a factor in…

Read more Integrating Koko Analytics stats 0 Comment on Integrating Koko Analytics stats
Continue reading How to block searches without a search term

How to block searches without a search term

By default, Relevanssi returns all posts when searching without a search term. That’s the default WordPress behaviour. Sometimes it may not be the wanted behaviour. One reason is performance: returning all results can be very slow. To stop Relevanssi from running when there’s no search term, add this to your site: This little function will…

Read more How to block searches without a search term 2 Comments on How to block searches without a search term
Continue reading German umlauts

German umlauts

…umlauts, you can change the collation. For German, use utf8mb4_german2_ci (actually, use utf8mb4_swedish_ci, see comments below): Now, the database will not ignore umlauts. Relevanssi also removes accents to match what the database does, so you must also undo that. Add this to your site: remove_filter( ‘relevanssi_remove_punctuation’, ‘remove_accents’, 9 ); Once…By default, the search ignores German umlauts. Searching for “uber” will also find “über” and so on. This ignorance is not a Relevanssi feature but instead governed by your database. The default database collation WordPress uses (utf8mb4_unicode_ci) ignores all accents, including umlauts. If you want the search to care about…

Read more German umlauts 1 Comment on German umlauts
Continue reading Italian plurals

Italian plurals

…$string ) { $words = explode( ‘ ‘, $string ); $new_words = array(); foreach ( $words as $word ) { $end = mb_substr( $word, -3 ); if ( ‘ghe’ === $end ) { $word = mb_substr( $word, 0, -3 ) . ‘ga’; } if ( ‘che’ === $end ) {…$word = mb_substr( $word, 0, -3 ) . ‘ca’; } $end = mb_substr( $word, -1 ); if ( mb_strlen( $word ) > 3 && in_array( $end, array( ‘a’, ‘e’, ‘i’, ‘o’ ) ) ) { $word = mb_substr( $word, 0, -1 ); } $new_words[] = $word; } return implode( ‘……’, $new_words ); }, 10, 9 ); This function checks each word, and if it ends with “ghe” or “che”, the ending is changed to “ga” or “ca”, respectively. Then if the word is over three letters long, a final “a”, “e”, “i”, or “o” is stripped. Now plural and…

Read more Italian plurals 3 Comments on Italian plurals
Continue reading Attachment file content cannot be saved

Attachment file content cannot be saved

…some reason, that function is not accepting the custom field data. In these cases, the first thing to check is the database collation for the meta_value field in the wp_postmeta database table. The document may contain characters your database table cannot accept. Before WordPress 4.2, the default collation for the…databases used utf8 characters. Since 4.2, the collations have used utf8mb4 characters. It’s not unusual that PDF files contain characters that WordPress cannot save in a database table with a utf8 collation. To fix this, you need to change the database collation. You can make this change if you have……direct access to the database with phpMyAdmin, Adminer or some other tool. If you don’t know anything about databases or don’t have access to the database tables, you need to ask someone else to do this for you. Here’s what the wp_postmeta table may look like in Adminer: The collation…

Read more Attachment file content cannot be saved 0 Comment on Attachment file content cannot be saved
Continue reading The Events Calendar: The event search

The Events Calendar: The event search

…function will stop Relevanssi from interfering with The Events Calendar search. There’s a bug in the current version of Relevanssi (2.18.0 for Premium, 4.16.0 for free version): if you have enabled Relevanssi in admin searches, the event search won’t work. Disable Relevanssi in admin searches to make the search function….

Read more The Events Calendar: The event search 7 Comments on The Events Calendar: The event search