Mikko Saari
Forum Replies Created
-
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Exclude Woocommerce product categoriesYes, you can. It happens exactly as it does in the WP default search, using taxonomy parameters. See documentation here. For example, to exclude product categories 5 and 7, you can use:
add_filter( 'relevanssi_modify_wp_query', function( $query ) {
$tax_query = array(
array(
'taxonomy' => 'product_cat',
'terms' => array( 5, 7 ),
'operator' => 'NOT IN',
'field' => 'term_id',
)
);
$query->set( 'tax_query', $tax_query );
return $query;
} );Forum: Plugins
In reply to: [Relevanssi - A Better Search] Issue when using with Bricks / MetaboxSorry, but I can’t reproduce the problem. The metabox works for me; I can use it to find posts without problems. Metabox does a regular search query, Relevanssi is or is not involved, and I get results. I checked, and Relevanssi shouldn’t stop this query.
Is Relevanssi enabled for admin searches?
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Issue when using with Bricks / MetaboxYou can’t set custom field indexing to “none” because all content in Bricks is stored in the
_bricks_page_content_2
custom field. If you disable that, Relevanssi won’t be able to access any of your page content. Relevanssi doesn’t let you do that.The solution is probably to stop Relevanssi from interacting with that specific search. Unfortunately, I don’t understand what “my select2 search for a metabox ‘post’ field, configured as a custom user field” means. If this is something I can reproduce somehow without buying Metabox, I can look into this if you provide good instructions on how to reproduce this.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Question about free pluginThe way the search results look like is up to your theme. Relevanssi provides a list of results and if you choose so, better excerpts for the posts, but how those results and excerpts look like to the user depends on your theme’s search results template and stylesheet. So, if you want to modify that, work with your theme.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] No search resultsIn that case I don’t unfortunately have an answer. If you’re doing something Generate Press custom to display the search results, try using a plain WordPress search results template instead.
Well, you could always investigate what happens in the
relevanssi_gutenberg_block_rendering()
function (it’s in /lib/compatibility/gutenberg.php) to see how the block is handled and what the function returns. If the function returns an empty string as it should, then the next step is to figure out where the block content is coming from if not there. Is it possible the content is also somewhere else?Forum: Plugins
In reply to: [Relevanssi - A Better Search] No search resultsIs this perhaps the solution? https://www.relevanssi.com/knowledge-base/generatepress-query-loop/
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Customise the search resultsThere’s no need to modify the core files. Live Ajax Search can read the template from the directory
/relevanssi-live-ajax-search/
under your theme, so copy your modified template there.Thanks, that’s a good observation.
That’s curious. I don’t know what’s going on here and where the block content comes in. What you’re doing should be enough.
What if you delete to block content in the
relevanssi_post_content
function? Does that get you rid of it for good?Forum: Plugins
In reply to: [Relevanssi - A Better Search] ElementorYou can try this:
add_filter( 'relevanssi_modify_wp_query', function( $query ) {
$query->set( 'e_search_props', '' );
return $query;
} );So the function triggers and returns
null
for the blocks? If you check withrelevanssi_post_content
on a priority higher than 10 (see https://www.relevanssi.com/user-manual/filter-hooks/relevanssi_post_content/), is the rendered block output included or not?If you check with the Relevanssi debugger, do the functions have any effect on the Relevanssi indexing?
Have you tried debugging these functions to see why they are not working?
In the first one, check what values
$block['blockName']
gets when you save the post. Is the name correct? Usually Gutenberg block names are prefixed with something, so perhaps there’s a prefix you’re missing.Forum: Plugins
In reply to: [Relevanssi - A Better Search] search not showing a pageOk, that strongly suggests your search results template doesn’t have paging. Please contact your theme support, they should be able to tell you how to enable the paging.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] search not showing a pageAre the ten visible results the first ten results of the Relevanssi search? Or is the order different? If you see the first ten results, then it sounds like your search results template is missing paging.