Voxycure Framework helps developers build WordPress themes faster by providing tools to create Custom Blocks, Field Groups, and Theme Option Pages without heavy coding.
In this guide, we will create Global Theme Settings such as:
π¨ General Design & Color Settings
π· Header & Footer Controls
π Contact Information
π Social Media Links
β¦and any other global configuration you want
These settings can then be used anywhere inside your theme using simple functions.
π Step 1: Register a Theme Options Page
Create or paste this code inside functions.php or inside /includes/theme-settings.php:
<?php
/**
* Register a Theme Settings page + fields (Voxycure theme settings implementation)
*
* Uses the actual filters implemented by Theme_Settings class:
* - voxycure_option_pages
*
* The settings are stored under the option key: 'voxycure_settings'
*/
/**
* Register (or extend) settings pages.
*/
add_filter('voxycure_option_pages', function ($pages) {
// Add a page entry. The Theme_Settings class will merge/consume these entries.
$pages[] = [
'name' => __('Theme Settings', 'voxycure'),
'type' => 'options-page', // 'options-page' (page type used by theme)
'status' => 'active', // 'active' or 'inactive'
'slug' => 'voxycure-settings', // unique slug used to reference fields + option group
'option_key' => 'voxycure_settings', // where values are saved in wp_options
'capability' => 'manage_options', // WP capability required to view page
'tab_alignment' => 'vertical', // UI hint (vertical | horizontal)
'tabs' => [ // tab configuration for the page UI
['value' => 'colors', 'label' => __('Colors', 'voxycure')],
['value' => 'header', 'label' => __('Header', 'voxycure')],
['value' => 'footer', 'label' => __('Footer', 'voxycure')],
],
// Fields live INSIDE this same array (not using separate hook)
'fields' => [
// ---------------- colors TAB ----------------
[
'type' => 'color',
'label' => __('Primary Color', 'voxycure'),
'field_key' => 'primary_color',
'tab' => 'colors',
'default_value' => '#1d49c3',
],
[
'type' => 'color',
'label' => __('Secondary Color', 'voxycure'),
'field_key' => 'secondary_color',
'tab' => 'colors',
'default_value' => '#030303',
],
// ---------------- Header TAB ----------------
[
'type' => 'image',
'label' => __('Logo', 'voxycure'),
'field_key' => 'logo',
'tab' => 'header',
],
[
'type' => 'link_button',
'label' => __('Header Button', 'voxycure'),
'field_key' => 'header_button',
'tab' => 'header',
],
// ---------------- Footer TAB ----------------
[
'type' => 'image',
'label' => __('Footer Logo', 'voxycure'),
'field_key' => 'logo',
'tab' => 'footer',
],
[
'type' => 'textarea',
'label' => __('About the Company', 'voxycure'),
'field_key' => 'about_company',
'tab' => 'footer',
],
],
];
return $pages;
});
β What this code does
| Feature | Description |
|---|---|
| Creates Theme Settings Menu | Appears inside WP-Admin β Theme Options |
| Adds Tabs | (Colors / Header / Footer etc.) |
| Registers Fields | Color Picker, Image Upload, Textarea, Button⦠|
| Saves values in DB | under voxycure_settings option key |
π Setting Configuration Key Reference
Youβll see these keys in the class. Add this to your doc so users know what each key does:
| Key | Description |
|---|---|
name | Admin page title |
type | Should be 'options-page' |
status | 'active' or 'inactive' |
slug | Unique page slug |
option_key | DB option key used to store values |
capability | Permission required (manage_options) |
tabs | Tab navigation config |
fields | Input fields shown inside page |
tab_alignment | ‘vertical’ or ‘horizontal’ |
π Step 3: Display Settings in Frontend Theme
Now fetch option value anywhere (header.php, footer.php, block template, etc.)
<?php
// Get a single option value
$primary_color = voxycure_get_option('voxycure_settings.colors.primary_color');
// Optional fallback default value
$logo = voxycure_get_option('voxycure_settings.header.logo', 'Default logo URL');
// Print value safely
echo esc_html($primary_color);
Optional: Create helper function (recommended for themes)
Example helper file:
π https://github.com/Voxycure-Infotech/voxycure-theme/blob/main/includes/functions.php#L31
Usage Example:
π https://github.com/Voxycure-Infotech/voxycure-theme/blob/main/template-parts/headers/style1.php#L15
π Reference & Advanced Implementation
π Official Voxycure Theme Settings structure:
https://github.com/Voxycure-Infotech/voxycure-theme/blob/main/includes/class-theme-settings.php
π Summary
With Voxycure Framework you can:
β Build unlimited Theme Options Pages
β Add fields without plugins like ACF/Redux
β Store & retrieve global settings easily
β Use values anywhere with voxycure_get_option()
Perfect for branding controls, layout settings, global variables, social links, and more.