# Configuration

Make sure you've installed Alchemy Options either as a [plugin](/v0.9/installation.md#using-alchemy-options-as-a-plugin) or as [part of your theme](/v0.9/installation.md#using-alchemy-options-in-your-theme). Then add a function to the `init` hook in your `functions.php`. [Sample configuration objects](/v0.9/samples.md) are available for a quick copy and paste.

```php
function add_custom_options() {
    if( ! class_exists( 'Alchemy_Options\Includes\Options' ) || wp_doing_ajax() ) {
        return;
    }

    $options = array(
        'options' => array(
            /* options will go here */
        ),
    );

    new Alchemy_Options\Includes\Options( $options );
}

add_action( 'init', 'add_custom_options' );
```

That's it, just add [some options](/v0.9/fields.md) instead of `/* options will go here */` and see them appear on the Alchemy Options page.

## Grouping

If there's a need to split options into several groups, Alchemy Options has got you covered. You may add the `tabs` section to the config that looks like this:

```php
...
'tabs' => array(
    'tab-one-id' => array(
        'title' => 'Tab one'
    ),
    'tab-two-id' => array(
        'title' => 'Tab two'
    ),
)
...
```

Keys of the `tabs` array should be unique, these values will be used in configuring of each option with the `tab` key. If no `tab` key is found in each option's settings it will be rendered in each tab.

Thus, the `$options` variable from above will look like this:

```php
...
$options = array(
    'tabs' => array(
        'tab-one-id' => array(
            'title' => 'Tab one'
        ),
        'tab-two-id' => array(
            'title' => 'Tab two'
        ),
    ),
    'options' => array(
      /* options will go here */
    )
);
...
```

If there's a need to split options even further, there's a [`sections`](/v0.9/fields/sections.md) type for visual splitting of fields into togglable sections and a [`field-group`](/v0.9/fields/field-group.md) type to group related fields together for an easier [value retrieval](/v0.9/functions/alch_get_option.md).


---

# 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://docs.alchemy-options.com/v0.9/configuration.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.
