Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Show Image in Search Results (Pods)
This topic contains 13 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 5 months ago.
- AuthorPosts
- March 25, 2021 at 9:08 pm #32331
Hi Team,
I implemented the search engine on my website and want to show the pods term meta (image) as well. I tried using _pods_cp_store_image and cp_store_image but none of them work. Can you please help me out here? This is kinda the primary function I needed this plugin for
March 25, 2021 at 9:31 pm #32332You cannot access this content.March 26, 2021 at 10:50 am #32344Hi,
Thank you for the details. I checked the issue via the back-end, and made an adjustment to the terms image parser. Now the images should be returned correctly (via the cp_store_image field)
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 26, 2021 at 11:05 am #32345Amazing, that was quick. I just checked and it works!! Thanks a lot!
Also is there a way to show an extra text field in place of description? The description should be replaced by another Pods field cp_store_website or remove the Description field and display this field instead
March 26, 2021 at 11:16 am #32348You are welcome.
Well, it depends, it might be doable programmatically. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
Best,add_filter( "asp_results", "asp_term_meta_desc", 10, 1 ); function asp_term_meta_desc( $results ) { // Field name $field = 'cp_store_website'; // ---------------------------------------------- // --- Do not change anything below this line --- // ---------------------------------------------- foreach ( $results as $k => &$r ) { if ( $r->content_type == 'term' ) { $s = get_term_meta( $r->id, $field, true ); if ( !empty($s) ) $r->content = $s; } } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 26, 2021 at 11:32 am #32349That worked!! You rock Ernest!! Is there a way to reduce the highlighted space and blue border thickness?
Attachments:
You must be logged in to view attached files.March 26, 2021 at 1:49 pm #32352Sure, you can change the margin between the box and the results here. The padding between the items and the container is fix, but you can change the background of it to white, and add individual border: https://i.imgur.com/QLpTmfi.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 26, 2021 at 2:55 pm #32361I made the margin to 0 but there’s still some space. I tried to make the margin negative but it doesn’t let me enter a negative value. I ideally want the results box to be stuck to the search box
March 26, 2021 at 3:06 pm #32364Also is there a way in mobiles the search bar is hidden but only a search icon is shown. When a user clicks on the icon the bar becomes visible?
March 26, 2021 at 3:27 pm #32367Try forcing it via custom CSS:
.asp_r_1 { margin-top: -14px !important; }
It is possible to use the compact layout mode, but it is hard coded for all devices. You may have to create two separate search bars, one for mobile and one for desktop. Then on the General Options -> Mobile panel you can hide one from mobile one from desktop.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2021 at 3:18 pm #32377Gotcha! Is there a way to disable the plugin if the URL contains a parameter? I am able to detect the URL and check if-else conditions on it but not sure how to disable/prevent scripts/css from loading.
March 29, 2021 at 1:11 pm #32391There is a conditional asset loader feature, otherwise you can use the asp_load_css_js filter for programmatical solutions.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 7, 2022 at 1:25 pm #39886Is there a way to show content from two fields in the search results. One visible and one hidden
November 7, 2022 at 2:26 pm #39890Yes – use the advanced title and content fields for that.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
The topic ‘Show Image in Search Results (Pods)’ is closed to new replies.