Theme Functions
Theme functions are to be used within the current site theme files
Gets an Ajax Search Pro result specific field, such as image, relevance etc.. and prints it. This function only works within the search.php file scope, when the search was performed via Ajax Search Pro form, and the search override was active.
the_asp_result_field($field, $echo = true);
$field (string) (required) - Field name
image
, relevance
, priority
, group_priority
, blogid
, content_type
as well as title
, content
, id
$echo (bool) (optional) - To print the output or not. Default
true
(mixed|bool) - The field value or
false
, when field does not existReturns an (or all) Ajax Search Pro results specific field(s), such as image, relevance etc.. This function only works within the search.php file scope, when the search was performed via Ajax Search Pro form, and the search override was active.
get_asp_result_field($field = 'all', $post = false);
- $field (string) (optional) - Field name
image
,relevance
,priority
,group_priority
,blogid
,content_type
as well astitle
,content
,id
orall
to get all fields as an object - $post (WP_Post|int) (optional) - Post ID or Object. If not set, then the global $post is used.
(mixed|bool) - The field value or, object of field values or
false
, when field does not existLast modified 8mo ago