Hello @ottjobs
Thank you so much for using our plugin. Some styles are inherited from the theme active on your WordPress.
To increase the font-size, please, go to the menu option: “Appearance > Customize > Additional CSS”, and enter the style definition below:
.search-in-place .resume{font-size:14px !important;}
Since, you use SiteGround cache, it is recommended to purge the website’s cache after modifying the style.
To include additional attributes in the search results, you need some custom coding. You can use the following piece of code as part of the function.php file of the theme active on your WordPress:
add_filter('search-in-page-item', function($obj, $id){
global $wpdb;
$sku = $wpdb->get_var(
$wpdb->prepare('SELECT meta_value FROM '.$wpdb->postmeta.' WHERE meta_key="_sku" AND post_id=%d', $id)
);
if(!empty($sku)) $obj->resume = '<b>SKU: '.$sku.'</b><br />'.$obj->resume;
return $obj;
}, 10, 2);
Best regards.
Both worked PERFECTLY! Oh my goodness, thank you!
Wish I could show you an image of it.
Is there a way to not show the SKU for some search in place sections? The reason is I will also have clients performing searches and I would prefer they not see the SKU.
How I’m doing it: for the employees, I’ve put a search in place inside their login, but limited their searches to post_types=products. For clients, I am putting search in place on the home page, but limiting their searches to post_types=pages, and pages will only have the services listed.
For the clients, I’d like their box to avoid showing SKU
(It’s ok to end this here if it’s too much to figure out)
Hello @ottjobs
The code I sent you includes the condition:
if(!empty($sku)) $obj->resume = '<b>SKU: '.$sku.'</b><br />'.$obj->resume;
For pages, the condition will fail, and the search result will not include the SKU information.
Best regards.