Continue reading Indexing embedded PDFs for the parent post

Indexing embedded PDFs for the parent post

…} } return $block; } ); PDF.js Viewer Shortcode PDF.js Viewer Shortcode uses a shortcode with the file name in the url parameter. add_filter( ‘relevanssi_content_to_index’, ‘rlv_pdfjs_content’, 10, 2 ); function rlv_pdfjs_content( $content, $post ) { $m = preg_match_all( ‘/\[pdfjs-viewer url=[“\’](.*?)[“\’]/’, $post->post_content, $matches ); if ( $m ) { global $wpdb;……need to establish a connection between the PDF and the post, based on the URL in the shortcode. The same code works with different PDF embedders; you only have to adjust the regex to match the shortcode used by the plugin. WordPress Core File block If you use the default……WordPress. Thus, Relevanssi won’t know the PDF is embedded in the post and cannot index the PDF contents for the parent post. Most of these plugins use shortcodes to embed the PDF viewer on a page. To get Relevanssi to index the embedded PDF contents for the parent post, you…

Read more Indexing embedded PDFs for the parent post 5 Comments on Indexing embedded PDFs for the parent post
Continue reading Chamber Dashboard Business Directory

Chamber Dashboard Business Directory

The Chamber Dashboard Business Directory plugin has a business directory search that’s not compatible with Relevanssi. To disable Relevanssi in those searches, add this to your theme functions.php: add_filter( ‘relevanssi_prevent_default_request’, ‘rlv_allow_chamber_search’, 10, 2 ); function rlv_allow_chamber_search( $prevent, $query ) { if ( isset( $_GET[‘searchtext’] ) ) { $prevent = false;……( isset( $_GET[‘searchtext’] ) ) { $prevent = false; } return $prevent; } This will make the business directory search work again. However, I would recommend just using Relevanssi to search the business directory as well – that’s possible, and you don’t need to use the Business Directory default search….

Read more Chamber Dashboard Business Directory 0 Comment on Chamber Dashboard Business Directory
Continue reading Toolset Views

Toolset Views

Relevanssi works fine with Toolset, thanks to a lot of compatibility code the makers of Toolset have included in it to make it work with Relevanssi. However, everything doesn’t work automatically without modifications. The key thing to notice with Toolset is that query variables and filters don’t work the way……you’d expect. Because of the way the Toolset Relevanssi compatibility is built, the query variables are not passed to Relevanssi from the search query like they are when Toolset is not involved. This may lead to confusion, when adding a query variable (for example &post_types=page) to the URL has no……effect on the results, even though you can tell for sure the search is powered by Relevanssi. The reason is simple: Relevanssi doesn’t see that query variable, because Toolset does not pass it to Relevanssi. Fortunately Toolset provides means to fix this. There’s a filter hook you can use to…

Read more Toolset Views 6 Comments on Toolset Views
Continue reading Gmedia photo gallery tags

Gmedia photo gallery tags

…global $gmDB; $tags = $gmDB->get_the_gmedia_terms( $id, ‘gmedia_tag’ ); if ( is_array( $tags ) ) { foreach ( $tags as $tag ) { $content .= $tag->name; } } } } return $content; } This checks the post type: if it’s gmedia, the photo ID in the Gmedia database is fetched from……That’s because Gmedia gallery doesn’t use that taxonomy for the tags. The tags are actually in a separate, proprietary taxonomy Relevanssi won’t have access at all. There is a solution, though. When indexing gallery photos, you can add a function that reads in the actual Gmedia tags, and adds them…Gmedia photo gallery gives a false impression of working with Relevanssi, as you can see the gmedia_tag taxonomy appear in the list of taxonomies: gmedia_tag is listed in the list of taxonomies to index. However, if you try to index those tags, you’ll soon notice Relevanssi isn’t actually indexing them….

Read more Gmedia photo gallery tags 0 Comment on Gmedia photo gallery tags
Continue reading WP Job Manager

WP Job Manager

Relevanssi doesn’t work with the WP Job Manager search. The solution is fortunately simple: you can just disable Relevanssi for the WP Job Manager page. To disable Relevanssi, add this to your site: add_action( ‘get_job_listings_init’, ‘relevanssi_fix_for_wp_job_manager’ ); function relevanssi_fix_for_wp_job_manager(){ remove_filter( ‘posts_request’, ‘relevanssi_prevent_default_request’ ); remove_filter( ‘the_posts’, ‘relevanssi_query’ ); } Thanks to…

Read more WP Job Manager 0 Comment on WP Job Manager
Continue reading WPML: Category exclusions

WPML: Category exclusions

Relevanssi category exclusion setting doesn’t work properly with WPML. Here’s a bit of code from Srdjan Jocić from OnTheGoSystems that fixes it. Just add this to your theme functions.php. add_filter( ‘relevanssi_search_filters’, ‘wpml_relevanssi_include_exclude_cats_fix’ ); function wpml_relevanssi_include_exclude_cats_fix( $args ) { if ( array_key_exists( ‘tax_query’, $args ) && did_action( ‘wpml_loaded’ ) ) {…

Read more WPML: Category exclusions 0 Comment on WPML: Category exclusions
Continue reading SearchWP Live Ajax Search

SearchWP Live Ajax Search

…One example is searching for attachments. By default, SearchWP Live Ajax Search doesn’t include any attachments in the search results. The post type is not a problem, but the post status is: SearchWP Live Ajax Search includes only posts with the post status publish, while attachments have a status of…Relevanssi doesn’t ship with a live search or autocomplete feature that would display results as the user types the search terms. There are many other plugins that provide this functionality, but few of these plugins work with Relevanssi. SearchWP Live Ajax Search is the best one that does. It’s very……to include private posts for the users who are allowed to see them. Just removing the post_status parameter will include drafts in the results. Normally drafts shouldn’t appear in searches, but since the SearchWP Live Ajax Search is an AJAX search, it is done in admin context, where drafts are…

Read more SearchWP Live Ajax Search 13 Comments on SearchWP Live Ajax Search
Continue reading bbPress: Private Groups support

bbPress: Private Groups support

Private Groups is a plugin that makes bbPress forum groups private. Relevanssi, however, doesn’t understand that privacy and will show those groups in the search results. Relevanssi has means to support this, however, with the help of the relevanssi_post_ok filter. Here’s some code from Mark Wass that makes the private forum posts private in search.…

Read more bbPress: Private Groups support 0 Comment on bbPress: Private Groups support