Last updated on : December 7, 2025

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:

functions.php 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

FeatureDescription
Creates Theme Settings MenuAppears inside WP-Admin β†’ Theme Options
Adds Tabs(Colors / Header / Footer etc.)
Registers FieldsColor Picker, Image Upload, Textarea, Button…
Saves values in DBunder 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:

KeyDescription
nameAdmin page title
typeShould be 'options-page'
status'active' or 'inactive'
slugUnique page slug
option_keyDB option key used to store values
capabilityPermission required (manage_options)
tabsTab navigation config
fieldsInput 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
<?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.