Show Image in Search Results (Pods)

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Show Image in Search Results (Pods)

This topic contains 11 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 1 month ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #32331
    sakshamtalwar67
    sakshamtalwar67
    Participant

    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

    #32332
    sakshamtalwar67
    sakshamtalwar67
    Participant
    You cannot access this content.
    #32344
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #32345
    sakshamtalwar67
    sakshamtalwar67
    Participant

    Amazing, 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

    #32348
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You 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!

    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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #32349
    sakshamtalwar67
    sakshamtalwar67
    Participant

    That 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.
    #32352
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Sure, 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 :)


    #32361
    sakshamtalwar67
    sakshamtalwar67
    Participant

    I 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

    #32364
    sakshamtalwar67
    sakshamtalwar67
    Participant

    Also 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?

    #32367
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Try 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 :)


    #32377
    sakshamtalwar67
    sakshamtalwar67
    Participant

    Gotcha! 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.

    #32391
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    There 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 :)


Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.