mdcoops
Forum Replies Created
-
Mikko, I made some progress. I created a custom template for my search php file and assigned this file to a page that I call from the menu. I’ve added the following code to a custom loop-search-customname.php file (and I checked, it is being called).
$args = array(
‘post_type’ => ‘documents’,
‘meta_query’ => array(
array(
‘key’ => ‘author’,
‘value’ => ‘kirk’,
),
),
);
$my_query = new WP_Query( $args );
$my_query->query_vars[‘s’];
relevanssi_do_query($my_query);
—
the wootheme template then goes through the Loop…
I get no results and get_search_query() returns nothing.Thanks Mikko, I’m getting there with this advice. A related question to the same site: Besides a full library search with custom field limits, I also want to provide some custom search archive results. I am moving a site to WordPress. You can see how I have this working with my old site using php/MySQL. This is one of a number of unique archives: https://www.shotpeener.com/library/kirk_articles.php This page queries the author field of the library database for “kirk”. This is not the only page like this.
With the new WordPress site (in development) I have used ACF for custom fields like author and source. I’m trying to figure out how to use Relevanssi to do something similar to the old site. I’m a bit at a loss, but think that doing a direct query as you describe here (https://www.relevanssi.com/knowledge-base/relevanssi_do_query/) and using meta_query to query the custom field. I’m not sure how to put this together i.e, what kind of conditional statement to add to filter and where to call the relevanssi_do_query() function, and how to create menu item.
I’m using Wootheme Canvas. Thanks much.