This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

show images on the multisite results page

Home Forums Product Support Forums Ajax Search Pro for WordPress Support show images on the multisite results page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #21114
    alanalan
    Participant
    #21124
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    It is a bit hard to answer, in some cases it might be possible. Generally multisite results pages are not capable of displaying results from across sites. There is a method in ajax search pro to basically force these results as ‘fake’ posts and change their URLs.

    If you are somewhat familiar with theme coding, or already made changes to the theme files, then there is a theme function API available for the plugin. So if you can somehow locate the theme code where the images are printed, you could use this method (within the loop) to get the images parsed by Ajax Search Pro:

    get_asp_result_field('image');

    ..this returns the result image, if available. I am honestly not sure if this would work with any multisite environment though.

    #21152
    alanalan
    Participant

    You cannot access this content.

    #21157
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Your idea seems correct to me, to be honest, the code seems to be okay. However I am not sure where the ‘rh_no_thumb_url’ custom filter is executed, it might be out of the loop. It is also possible that the post data from the search is no longer available at that point, and then the function is not able to return it.

    If you want, you can add temporary FTP details, and I can try to debug through the code, to see what exactly is happening.

    #21158
    alanalan
    Participant

    You cannot access this content.

    #21174
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thank you!

    I have added the following code to the functions.php file in the theme directory, I think it’s working now:

    add_filter('rh_no_thumb_url', 'asp_custom_def_image');
    function asp_custom_def_image($imagee){
      $imagee  =  get_asp_result_field($field = 'image');
      return $imagee;
    }
    #21180
    alanalan
    Participant

    Ohhh thank you! you’re the best

    #21181
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.