Advanced Options – Content – Settings question

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Advanced Options – Content – Settings question

This topic contains 4 replies, has 2 voices, and was last updated by ajmartin ajmartin 6 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7676
    ajmartin
    ajmartin
    Participant

    Secondary Title Field for Posts/Pages/CPM and Secondary Description Field for Posts/Pages/CPM

    how do I use these? They don’t seem to show up in the results template – I am using vertical result.

    Thanks,
    AJ

    #7677
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi AJ,

    It’s for an alternative source if the primary is empty or does not exist.

    For example you select the “Post Excerpt” for the primary description field and “Post content” for the secondary. The plugin will try to get the excerpt first, if it’s empty, then moves to the secondary source and gets the post content.

    Best,
    Ernest Marcinko

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


    #7678
    ajmartin
    ajmartin
    Participant

    Ah ok thanks – when I try to use the advanced fields it doesn’t seem to work – for example I want to combine the Description Field and the Title Field together in one field but for some reason doesn’t seem to recognize – to use those do you need to make both other fields blank?

    #7681
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    You cannot combine them to one field via the settings, it’s not possible. What you can do, is to create a custom filter, something like:

    
    add_filter( 'asp_results', 'asp_merge_field_results', 1, 1 );
     
    function asp_merge_field_results( $results ) {
      foreach ($results as $k=>$v) {
        $results[$k]->content  = $v->title . " " . $v->content;
      }
     
      return $results;
    }
    

    This code will for example combine the title and the content field into the content field. You can make and put these types of filters into your active theme folder, into the functions.php file.

    Best,
    Ernest Marcinko

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


    #7684
    ajmartin
    ajmartin
    Participant

    wow thanks for such a detailed response. The instructions around the advanced fields led me to believe I could create my own custom field on the fly. This makes sense – would this filter on the title field or ? I guess I am still confused on what would trigger this filter and where it would appear.

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

You must be logged in to reply to this topic.