Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
March 25, 2025 at 4:50 pm in reply to: Search results: include products and only a select few pages? #53466Ernest Marcinko
KeymasterHi,
Well, this is a tough one. If you have not too many pages, and they don’t change very ofthen, then excluding the remainder manually by ID is the best bet.
However if the pages change ofthen and there is a lot of them, then perhaps consider creating a taxonomy and put the excluded pages there and exclude that.
If none of that works, then still you have exclusions by custom fields.
I would not use any type of inclusion rule here, because for the items to be included they all have to match the criteria – that also applies for all post types, including the products.
Ernest Marcinko
KeymasterThanks Matt!
The CSS class was not added to the grid, so it was not in effect. I have added it for you, now the results apply correctly.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
March 25, 2025 at 8:52 am in reply to: No search results in secondary language using Polylang #53455Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
It is most likely showing items whihc may not be tagged yet. Make sure to turn off this option, that should resolve the problem.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterGreat! I’m happy to hear that!
When doing a search, is your plugin searching for the entire page including those related articles? If yes, how can we prevent this as the search results page titles are going to be very confusing.
It only searches the selected fields – post titles, content, excerpts. If the related items are not part of the post content, then those are not searched. The only possible reason is if the related content is stored within the post content – aka you have to add it in the page builder/editor to ever single post, and is not part of a common template of some sort.
There is nothing much to do about it unfortunately. If it’s stored in the post content field, the plugin only sees that as part of the post content.It is however much more likely that the keyword logic is not set correctly or allows loose matches. First, I would try a more strict keyword logic to see how that changes everything. In most cases that does the trick nicely.
Ernest Marcinko
KeymasterHi Matt,
I will update that asap, thanks for noticing.
Here is a full video tutorial on how to set it up step-by-step: https://www.youtube.com/watch?v=RTbxpM1af4c
Ernest Marcinko
KeymasterSure! I have added it through the snippets plugin since it was installed.
I have only tested on the back-end that’s why I didn’t notice, the search is working there. So the issue seems to be a custom field filter, which is set on the front-end by a custom script you have. It adjusts the field with that hash value, which I assume no longer matches the database, but I don’t know what that is.
From what I can see that custom field_leafbridge_product_single_meta_retailer_iddoes not exist anymore, so that explains the problem.Ernest Marcinko
KeymasterNo big deal, but I did want to mention that while updating today ASP disabled itself? Strange behavior I thought you may want to know about.
That may have been the wordpress core updater, the plugin can’t really do that. The update process in wordpress is usually upload -> disable -> replace -> re-enable. If there was like a page reload or just a tiny server hickup for a millisecond, that could explain the plugin staying disabled after update.
It should not re-appear again though.Ernest Marcinko
KeymasterHi,
Thanks for the details!
I have added the following custom code to fetch the images for you:
add_filter('asp_results', function($results){ foreach ($results as &$r) { if ( $r->post_type !== 'product' ) continue; $schema = get_post_meta($r->id, 'lb_product_schema', true); $data = json_decode($schema, true); $r->image = isset($data['image'][0]) ? $data['image'][0] : $r->image; } return $results; });There is however one issue unrelated to the plugin. The images source domain have a same-origin policy, so even though they are linked to be displayed, the source domain is prohibiting to display them from anywhere else.
You may want to look at issue. It’s usually an option somewhere in the image domain CDN or on the apache/ngingx mod_rewrite rules.
The code above should work just fine, however I can’t guarantee anything as this is a customization.
-
AuthorPosts