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 8 years, 2 months ago.
- AuthorPosts
- February 10, 2016 at 9:29 pm #7676
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,
AJFebruary 10, 2016 at 9:34 pm #7677Hi 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 :)
February 10, 2016 at 9:47 pm #7678Ah 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?
February 11, 2016 at 10:08 am #7681Hi,
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 :)
February 11, 2016 at 2:41 pm #7684wow 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.
- AuthorPosts
You must be logged in to reply to this topic.