# Theme Functions

## Function: the\_asp\_result\_field

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](broken://pages/-L9jkL0dGdzzTTeIdM4G) was active.

### Usage

```
the_asp_result_field($field, $echo = true);
```

### Parameters

**$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`

### Return Values

(mixed|bool) - The field value or `false`, when field does not exist

## Function: get\_asp\_result\_field

Returns 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](broken://pages/-L9jkL0dGdzzTTeIdM4G) was active.

### Usage

```
get_asp_result_field($field = 'all', $post = false);
```

### Parameters

* **$field** (string) (optional) - Field name `image`, `relevance`, `priority`, `group_priority`, `blogid`, `content_type` as well as `title`, `content`, `id` or `all` 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.

### Return Values

(mixed|bool) - The field value or, object of field values or `false`, when field does not exist


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://knowledgebase.ajaxsearchpro.com/api/theme-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
