How to display terms image ? second

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to display terms image ? second

This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 9 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3276
    superman
    superman
    Participant

    Hi,
    https://wp-dreams.com/forums/topic/how-to-display-terms-image/#post-3225
    Thank you for your help. As last ticket that it doesn’t work. I have provided my FTP information and Key. you need to ues WinSCP to access.

    functions.php location:
    …../app-root/data/themes/CP/functions.php

    Term field and edit feld location:
    https://drive.google.com/file/d/0B4BrGeTR-ESZWGx1Z2xYNV9vT1k/view?usp=sharing

    Host name = Ftp server URL
    Private key file= Attachments
    Passphrase for key = Ftp Password

    Best
    Ken

    #3278
    superman
    superman
    Participant

    Hi,
    For security reason that I can’t upload ppk file. so I send you via email.

    Best
    Ken

    #3279
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thanks, got them.

    Just needed a minor modification, the final code is:

    
    add_filter( "asp_results", "asp_pods_image_results", 1, 1 );
        
    function asp_pods_image_results( $results ) {
      
      foreach ($results as $k=>$v) {
        // get the term images
        if ($results[$k]->image != null && $results[$k]->image != "")
           continue;
        $pod = pods("stores");
        $pod->fetch($results[$k]->id);
        $icon = $pod->get_field("icon");
        if ($icon != null && $icon != "")
          $results[$k]->image = $icon;
      }
        
      return $results;
    }
    

    It should work now.

    Best,
    Ernest Marcinko

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


    #3280
    superman
    superman
    Participant

    Great! It work. thank you!

    What variable affects the speed of dropdown ? Because I see other website can display result real time ,like Amazon.com .But it’s too slow to show results after I type keyword in my Aja search bar( I have set 2 for Minimal character count to trigger search). The hosting CPU, RAM or something else ?

    How can I do to make it display real time like Amazon search bar ?

    Best
    Ken

    #3281
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Well there are lots of different factors to this:

    1. Amazon is using a custom built software with an highly optimized database
    2. Their servers worth billions of dollars on a dedicated distributed network cluster
    3. Their search engine probably uses different dedicated server networks with an optimized and indexed database with different layers of caching

    And that’s just 3 things. A wordpress powered website will never ever come even close to the speed of an amazon or imdb like search engine. For instants speed you will need a much better database architecture than wordpress, a much better specialized (non generic) cms built for your purposes and an insanely fast server.

    I know people kind of expect that speed because they are used to it from google, amazon, imdb etc.., but it’s not possible within the limits of a simple wordpress installation. It might be possible without it – with a custom build software (preferably not written in php) and with a better database engine. WordPress is a great solution to skip these steps as it provides a comfortable CMS system, but the speed is usually the price.

    Best,
    Ernest Marcinko

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


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

The topic ‘How to display terms image ? second’ is closed to new replies.