Would love some help :)


#1

Hi there,

I am trying to restrict the swiftype search paramaters to display only published and public pages, but I’m worried I’m going to mess it up. (I am not a developer or coder and should not be left alone with wordpress themes, but I’m the only one here to do it, so please help!)

I’ve narrowed in on our swiftype search params code in the functions.php. Pasted below


///////////////////////// search params ////////////////////////////
function swiftype_search_params_filter( $params ) {
// set the types to allow
$params[‘filters[posts][object_type]’] = array(
‘post’,
‘episode’,
‘series’,
‘product’,
‘webinar’,
‘course’,
‘week’,
‘vault’
);

return $params;

}

add_filter( ‘swiftype_search_params’, ‘swiftype_search_params_filter’, 8, 1 );

function swiftype_javascript_config() {
?>

<?php
}

add_action( ‘wp_head’, ‘swiftype_javascript_config’ );


If anyone could help me decide the best way to edit this or add something to make the search buckets only display published public pages that would be so great.

Thanks!


#2

Did you see this previous question? How can I exclude certain posts from search results using the Swiftype WordPress plugin?