{"id":5187,"date":"2022-06-29T08:45:42","date_gmt":"2022-06-29T12:45:42","guid":{"rendered":"https:\/\/www.cloudsurph.com\/?p=5187"},"modified":"2022-06-29T08:57:06","modified_gmt":"2022-06-29T12:57:06","slug":"how-to-create-a-custom-theme-options-for-wordpress","status":"publish","type":"post","link":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/","title":{"rendered":"WordPress Settings API: Creating Custom Theme Options"},"content":{"rendered":"<h4>How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options.<\/h4>\n<h5><em><strong>You can purchase your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting from Cloudsurph.com<\/a>,\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">Cloudsurph hosting<\/a>\u00a0is a reliable hosting option for business and personal projects. We offer insight and help on system configuration issues and code errors or bugs<\/strong>.<\/em><\/h5>\n<p><strong>As a WordPress Theme Developer or Designer, do you always think of what extra could be provided to your customers or any clients? <\/strong><\/p>\n<p><strong>WordPress Custom Theme Options! Yes, you can Customize your theme with WordPress Settings API and empower users with options to quickly modify its appearance and theme settings. <\/strong><\/p>\n<p><strong>This is what you need right now stay ahead in the play and, <\/strong>a Theme settings page to alter its appearance and style.<\/p>\n<p><em><strong>IF you want then buy a good, reliable, secure web\u00a0<a href=\"https:\/\/www.cloudsurph.com\/windows-vps-hosting\/\">hosting<\/a>\u00a0service \u00a0from here:\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">click here<\/a><\/strong><\/em><\/p>\n<p>So, now if you have a custom WordPress theme then you will follow this article to create custom theme options.<\/p>\n<p>In this article we, will show you how to create a Custom Theme Options Page for WordPress Theme.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5189\" src=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/how-to-create-a-logo-upload-option-to-custom-theme-option.png\" alt=\"how-to-create-a-logo-upload-option-to-custom-theme-option\" width=\"877\" height=\"567\" srcset=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/how-to-create-a-logo-upload-option-to-custom-theme-option.png 877w, https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/how-to-create-a-logo-upload-option-to-custom-theme-option-480x310.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 877px, 100vw\" \/><\/p>\n<h2>WordPress Settings API: Creating Custom Theme Options<\/h2>\n<p>Firstly, go to your custom theme folder and create a new folder called \u201cadminoptions\u201d.<\/p>\n<p>After then you need to create some files to <strong>adminoptions<\/strong> folder as likes are: admin-options.php, admin.css, and custom.css<\/p>\n<p>You need to now just copy and paste the below code:<\/p>\n<h3>admin-options.php<\/h3>\n<pre class=\"prettyprint\">\r\n&lt;?php\r\n\r\n\/\/ Exit if accessed directly\r\nif ( ! defined( 'ABSPATH' ) ) {\r\nexit;\r\n}\r\n\r\nclass BR_Theme_Options {\r\nprivate $sections;\r\nprivate $checkboxes;\r\nprivate $settings;\r\n\r\n\/\/ Construct\r\npublic function __construct() {\r\n\r\n\/\/ This will keep track of the checkbox options for the validate_settings function.\r\n$this-&gt;checkboxes = array();\r\n$this-&gt;settings = array();\r\n$this-&gt;get_settings();\r\n\r\n$this-&gt;sections['logo-options'] = __( 'Logo Options' );\r\n\/\/$this-&gt;sections['footer-about'] = __( 'Footer About' );\r\n$this-&gt;sections['social'] = __( 'Social Media' );\r\n$this-&gt;sections['general'] = __( 'General Setting' );\r\n$this-&gt;sections['appearance'] = __( 'Appearance Setting' );\r\n$this-&gt;sections['reset'] = __( 'Reset to Defaults' );\r\n\r\nadd_action( 'admin_menu', array( &amp;$this, 'add_pages' ) );\r\nadd_action( 'admin_init', array( &amp;$this, 'register_settings' ) );\r\n\r\nif ( ! get_option( 'theme_settings' ) )\r\n$this-&gt;initialize_settings();\r\n}\r\n\r\n\/\/ Add options page\r\npublic function add_pages() {\r\n\r\n$admin_page = add_theme_page( __( 'Theme Options' ), __( 'Theme Options' ), 'manage_options', 'theme-settings', array( &amp;$this, 'display_option' ) );\r\n\r\n\/\/ Load Script and Stylesheet\r\nadd_action( 'admin_print_scripts-' . $admin_page, array( &amp;$this, 'scripts' ) );\r\nadd_action( 'admin_print_styles-' . $admin_page, array( &amp;$this, 'styles' ) );\r\n\r\n}\r\n\r\n\/\/ Create settings field\r\npublic function create_setting( $args = array() ) {\r\n\r\n$defaults = array(\r\n'id' =&gt; 'default_field',\r\n'title' =&gt; __( 'Default Field' ),\r\n'desc' =&gt; __( 'This is a default description.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'general',\r\n'choices' =&gt; array(),\r\n'class' =&gt; ''\r\n);\r\n\r\nextract( wp_parse_args( $args, $defaults ) );\r\n\r\n$field_args = array(\r\n'type' =&gt; $type,\r\n'id' =&gt; $id,\r\n'desc' =&gt; $desc,\r\n'std' =&gt; $std,\r\n'choices' =&gt; $choices,\r\n'label_for' =&gt; $id,\r\n'class' =&gt; $class\r\n);\r\n\r\nif ( $type == 'checkbox' )\r\n$this-&gt;checkboxes[] = $id;\r\n\r\nadd_settings_field( $id, $title, array( $this, 'display_setting' ), 'theme-settings', $section, $field_args );\r\n}\r\n\r\n\/\/ Display options page\r\npublic function display_option() {\r\n\r\necho '&lt;div class=\"wrap\"&gt;\r\n&lt;div class=\"icon32\" id=\"icon-options-general\"&gt;&lt;\/div&gt;\r\n&lt;h1&gt;' . __( 'Theme Options' ) . '&lt;\/h1&gt;';\r\n\r\nif ( isset( $_GET['settings-updated'] ) &amp;&amp; $_GET['settings-updated'] == true )\r\necho '&lt;div class=\"updated fade\"&gt;&lt;p&gt;' . __( 'BR Theme Options updated.' ) . '&lt;\/p&gt;&lt;\/div&gt;';\r\n\r\necho '&lt;form action=\"options.php\" method=\"post\"&gt;';\r\n\r\nsettings_fields( 'theme_settings' );\r\necho '&lt;div class=\"ui-tabs\"&gt;\r\n&lt;ul class=\"ui-tabs-nav\"&gt;';\r\n\r\nforeach ( $this-&gt;sections as $section_slug =&gt; $section )\r\necho '&lt;li&gt;&lt;a href=\"#' . $section_slug . '\"&gt;' . $section . '&lt;\/a&gt;&lt;\/li&gt;';\r\n\r\necho '&lt;\/ul&gt;';\r\ndo_settings_sections( $_GET['page'] );\r\n\r\necho '&lt;\/div&gt;\r\n&lt;p class=\"submit\"&gt;&lt;input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"' . __( 'Save Changes' ) . '\" \/&gt;&lt;\/p&gt;&lt;\/form&gt;';\r\n\r\necho '&lt;script type=\"text\/javascript\"&gt;\r\njQuery(document).ready(function($) {\r\nvar sections = [];';\r\n\r\nforeach ( $this-&gt;sections as $section_slug =&gt; $section )\r\necho \"sections['$section'] = '$section_slug';\";\r\n\r\necho 'var wrapped = $(\".wrap h2\").wrap(\"&lt;div class=\\\"ui-tabs-panel\\\"&gt;\");\r\nwrapped.each(function() {\r\n$(this).parent().append($(this).parent().nextUntil(\"div.ui-tabs-panel\"));\r\n});\r\n$(\".ui-tabs-panel\").each(function(index) {\r\n$(this).attr(\"id\", sections[$(this).children(\"h2\").text()]);\r\nif (index &gt; 0)\r\n$(this).addClass(\"ui-tabs-hide\");\r\n});\r\n$(\".ui-tabs\").tabs({\r\nfx: { opacity: \"toggle\", duration: \"fast\" }\r\n});\r\n\r\n$(\"input[type=text], textarea\").each(function() {\r\nif ($(this).val() == $(this).attr(\"placeholder\") || $(this).val() == \"\")\r\n$(this).css(\"color\", \"#666\");\r\n});\r\n\r\n$(\"input[type=text], textarea\").focus(function() {\r\nif ($(this).val() == $(this).attr(\"placeholder\") || $(this).val() == \"\") {\r\n$(this).val(\"\");\r\n$(this).css(\"color\", \"#000\");\r\n}\r\n}).blur(function() {\r\nif ($(this).val() == \"\" || $(this).val() == $(this).attr(\"placeholder\")) {\r\n$(this).val($(this).attr(\"placeholder\"));\r\n$(this).css(\"color\", \"#666\");\r\n}\r\n});\r\n\r\n$(\".wrap h2, .wrap table\").show();\r\n\r\n\/\/ This will make the \"warning\" checkbox class really stand out when checked.\r\n\/\/ I use it here for the Reset checkbox.\r\n$(\".warning\").change(function() {\r\nif ($(this).is(\":checked\"))\r\n$(this).parent().css(\"background\", \"#c00\").css(\"color\", \"#fff\").css(\"fontWeight\", \"bold\");\r\nelse\r\n$(this).parent().css(\"background\", \"none\").css(\"color\", \"inherit\").css(\"fontWeight\", \"normal\");\r\n});\r\n\r\n\/\/ Browser compatibility\r\nif ($.browser.mozilla)\r\n$(\"form\").attr(\"autocomplete\", \"off\");\r\n});\r\n&lt;\/script&gt;\r\n&lt;\/div&gt;';\r\n\r\n}\r\n\r\n\/\/ Description for section\r\npublic function display_section() {\r\n\/\/ code\r\n}\r\n\r\n\/\/ HTML output for text field\r\npublic function display_setting( $args = array() ) {\r\n\r\nextract( $args );\r\n\r\n$options = get_option( 'theme_settings' );\r\n\r\nif ( ! isset( $options[$id] ) &amp;&amp; $type != 'checkbox' )\r\n$options[$id] = $std;\r\nelseif ( ! isset( $options[$id] ) )\r\n$options[$id] = 0;\r\n\r\n$field_class = '';\r\nif ( $class != '' )\r\n$field_class = ' ' . $class;\r\n\r\nswitch ( $type ) {\r\n\r\ncase 'heading':\r\necho '&lt;\/td&gt;&lt;\/tr&gt;&lt;tr valign=\"top\"&gt;&lt;td colspan=\"2\"&gt;&lt;h4&gt;' . $desc . '&lt;\/h4&gt;';\r\nbreak;\r\n\r\ncase 'checkbox':\r\n\r\necho '&lt;input class=\"checkbox' . $field_class . '\" type=\"checkbox\" id=\"' . $id . '\" name=\"theme_settings[' . $id . ']\" value=\"1\" ' . checked( $options[$id], 1, false ) . ' \/&gt; &lt;label for=\"' . $id . '\"&gt;' . $desc . '&lt;\/label&gt;';\r\n\r\nbreak;\r\n\r\ncase 'select':\r\necho '&lt;select class=\"select' . $field_class . '\" name=\"theme_settings[' . $id . ']\"&gt;';\r\n\r\nforeach ( $choices as $value =&gt; $label )\r\necho '&lt;option value=\"' . esc_attr( $value ) . '\"' . selected( $options[$id], $value, false ) . '&gt;' . $label . '&lt;\/option&gt;';\r\n\r\necho '&lt;\/select&gt;';\r\n\r\nif ( $desc != '' )\r\necho '&lt;br \/&gt;&lt;span class=\"description\"&gt;' . $desc . '&lt;\/span&gt;';\r\n\r\nbreak;\r\n\r\ncase 'radio':\r\n$i = 0;\r\nforeach ( $choices as $value =&gt; $label ) {\r\necho '&lt;input class=\"radio' . $field_class . '\" type=\"radio\" name=\"theme_settings[' . $id . ']\" id=\"' . $id . $i . '\" value=\"' . esc_attr( $value ) . '\" ' . checked( $options[$id], $value, false ) . '&gt; &lt;label for=\"' . $id . $i . '\"&gt;' . $label . '&lt;\/label&gt;';\r\nif ( $i &lt; count( $options ) - 1 )\r\necho '&lt;br \/&gt;';\r\n$i++;\r\n}\r\nif ( $desc != '' )\r\necho '&lt;br \/&gt;&lt;span class=\"description\"&gt;' . $desc . '&lt;\/span&gt;';\r\n\r\nbreak;\r\n\r\ncase 'textarea':\r\necho '&lt;textarea class=\"' . $field_class . '\" id=\"' . $id . '\" name=\"theme_settings[' . $id . ']\" rows=\"3\" cols=\"39\"&gt;' . format_for_editor( $options[$id] ) . '&lt;\/textarea&gt;';\r\n\r\nif ( $desc != '' )\r\necho '&lt;br \/&gt;&lt;span class=\"description\"&gt;' . $desc . '&lt;\/span&gt;';\r\n\r\nbreak;\r\n\r\ncase 'password':\r\necho '&lt;input class=\"regular-text' . $field_class . '\" type=\"password\" id=\"' . $id . '\" name=\"theme_settings[' . $id . ']\" value=\"' . esc_attr( $options[$id] ) . '\" \/&gt;';\r\n\r\nif ( $desc != '' )\r\necho '&lt;br \/&gt;&lt;span class=\"description\"&gt;' . $desc . '&lt;\/span&gt;';\r\n\r\nbreak;\r\n\r\ncase 'text':\r\ndefault:\r\necho '&lt;input class=\"regular-text' . $field_class . '\" type=\"text\" id=\"' . $id . '\" name=\"theme_settings[' . $id . ']\" value=\"' . esc_attr( $options[$id] ) . '\" \/&gt;';\r\n\r\nif ( $desc != '' )\r\necho '&lt;br \/&gt;&lt;span class=\"description\"&gt;' . $desc . '&lt;\/span&gt;';\r\n\r\nbreak;\r\n\r\ncase 'file':\r\n\r\necho '&lt;label for=\"upload_image\"&gt;\r\n&lt;input id=\"'.$id.'\" type=\"text\" size=\"36\" value=\"' . ( $options[$id] ) . '\" name=\"theme_settings[' . $id . ']\" \/&gt;\r\n&lt;input id=\"upload_logo_button\" type=\"button\" value=\"Upload Image\" \/&gt;\r\n&lt;br \/&gt;Enter an URL or upload an image for the logo.&lt;\/label&gt;\r\n&lt;script type=\"text\/javascript\"&gt;\r\njQuery(document).ready(function() {\r\njQuery(\\'#upload_logo_button\\').click(function() {\r\nformfield = jQuery(\\'#'.$id.'\\').attr(\\'name\\');\r\ntb_show(\\'\\', \\'media-upload.php?type=image&amp;TB_iframe=true\\');\r\nreturn false;});\r\nwindow.send_to_editor = function(response) {\r\njQuery(\"#view-'.$id.'\").html(response);\r\nvar imgurl=jQuery(\"#view-'.$id.'\").find(\"img\").attr(\"src\");\r\njQuery(\"#'.$id.'\").val(imgurl);\r\ntb_remove(); }\r\n\r\n});\r\n&lt;\/script&gt;\r\n&lt;div id=\"view-'.$id.'\"&gt;'.(!empty($options[$id])?'&lt;img style=\"max-width:100%;height:auto;\" src=\"'.$options[$id].'\"\/&gt;':'').'&lt;\/div&gt;';\r\n}\r\n}\r\n\r\n\/\/ Settings and defaults\r\npublic function get_settings() {\r\n\r\n\/* Logo Options\r\n===========================================*\/\r\n$this-&gt;settings['logo_options'] = array(\r\n'title' =&gt; __( 'Upload Your Logo' ),\r\n\"desc\" =&gt; \"Select an image file for set your logo.\",\r\n\"std\" =&gt; \"\",\r\n\"mod\" =&gt; \"\",\r\n\"type\" =&gt; \"file\",\r\n'section' =&gt; 'logo-options'\r\n);\r\n\r\n\/* Social Media\r\n===========================================*\/\r\n$this-&gt;settings['social_title'] = array(\r\n'title' =&gt; __( 'Social Title' ),\r\n'desc' =&gt; __( 'Enter the Social Title.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'social'\r\n);\r\n\r\n$this-&gt;settings['fb_link'] = array(\r\n'title' =&gt; __( 'Facebook Page Url' ),\r\n'desc' =&gt; __( 'Enter the facebook page url.' ),\r\n'std' =&gt; '#',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'social'\r\n);\r\n$this-&gt;settings['yt_link'] = array(\r\n'title' =&gt; __( 'YouTube Link Url' ),\r\n'desc' =&gt; __( 'Enter the YouTube link url.' ),\r\n'std' =&gt; '#',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'social'\r\n);\r\n$this-&gt;settings['lin_link'] = array(\r\n'title' =&gt; __( 'LinkedIn Link Url' ),\r\n'desc' =&gt; __( 'Enter the LinkedIn link url.' ),\r\n'std' =&gt; '#',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'social'\r\n);\r\n$this-&gt;settings['ins_link'] = array(\r\n'title' =&gt; __( 'Instagram Link Url' ),\r\n'desc' =&gt; __( 'Enter the Instagram link url.' ),\r\n'std' =&gt; '#',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'social'\r\n);\r\n$this-&gt;settings['tw_link'] = array(\r\n'title' =&gt; __( 'Twitter Link Url' ),\r\n'desc' =&gt; __( 'Enter the Twitter link url.' ),\r\n'std' =&gt; '#',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'social'\r\n);\r\n$this-&gt;settings['vi_link'] = array(\r\n'title' =&gt; __( 'Vimeo Link Url' ),\r\n'desc' =&gt; __( 'Enter the Vimeo link url.' ),\r\n'std' =&gt; '#',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'social'\r\n);\r\n\r\n\r\n\/* General Settings\r\n===========================================*\/\r\n$this-&gt;settings['contact_title'] = array(\r\n'title' =&gt; __( 'Contact Title' ),\r\n'desc' =&gt; __( 'Enter your Contact Title.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'general'\r\n);\r\n\r\n$this-&gt;settings['contact_addres'] = array(\r\n'title' =&gt; __( 'Contact Address' ),\r\n'desc' =&gt; __( 'Enter the Contact Address.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'general'\r\n);\r\n$this-&gt;settings['contact_hours'] = array(\r\n'title' =&gt; __( 'Contact Hours' ),\r\n'desc' =&gt; __( 'Enter the Contact Hours.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'general'\r\n);\r\n\r\n$this-&gt;settings['phone_num'] = array(\r\n'title' =&gt; __( 'Phone Number' ),\r\n'desc' =&gt; __( 'Enter your phone number.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'general'\r\n);\r\n$this-&gt;settings['mobile_num'] = array(\r\n'title' =&gt; __( 'Mobile Number' ),\r\n'desc' =&gt; __( 'Enter your Mobile number.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'general'\r\n);\r\n$this-&gt;settings['contact_email'] = array(\r\n'title' =&gt; __( 'Contact Email' ),\r\n'desc' =&gt; __( 'Enter the Contact Email ID.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'text',\r\n'section' =&gt; 'general'\r\n);\r\n\r\n\r\n\r\n\/* Appearance\r\n===========================================\r\n*\/\r\n$this-&gt;settings['cufon_enable'] = array(\r\n'section' =&gt; 'appearance',\r\n'title' =&gt; __( 'Enable Cufon font' ),\r\n'desc' =&gt; __( 'If checked cufon is working on site.' ),\r\n'type' =&gt; 'checkbox',\r\n'std' =&gt; 0 \/\/ Set to 1 to be checked by default, 0 to be unchecked by default.\r\n);\r\n$this-&gt;settings['favicon'] = array(\r\n'section' =&gt; 'appearance',\r\n'title' =&gt; __( 'Favicon' ),\r\n'desc' =&gt; __( 'Enter the URL (with http:\/\/) to your custom favicon. It should be 16x16 pixels in size.' ),\r\n'type' =&gt; 'text',\r\n'std' =&gt; ''\r\n);\r\n$this-&gt;settings['google_code'] = array(\r\n'section' =&gt; 'appearance',\r\n'title' =&gt; __( 'Google Analytics' ),\r\n'desc' =&gt; __( 'Enter your analytics code. Note: Add code include \"script\"' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'textarea',\r\n'class' =&gt; 'code'\r\n);\r\n\r\n$this-&gt;settings['custom_css'] = array(\r\n'section' =&gt; 'appearance',\r\n'title' =&gt; __( 'Custom Styles' ),\r\n'desc' =&gt; __( 'Enter any custom CSS here to apply it to your theme.' ),\r\n'std' =&gt; '',\r\n'type' =&gt; 'textarea',\r\n'class' =&gt; 'code'\r\n);\r\n\r\n\/* Reset\r\n===========================================*\/\r\n\r\n$this-&gt;settings['reset_theme'] = array(\r\n'section' =&gt; 'reset',\r\n'title' =&gt; __( 'Reset theme' ),\r\n'type' =&gt; 'checkbox',\r\n'std' =&gt; 0,\r\n'class' =&gt; 'warning', \/\/ Custom class for CSS\r\n'desc' =&gt; __( 'Check this box and click \"Save Changes\" below to reset theme options to their defaults.' )\r\n);\r\n\r\n}\r\n\r\n\/\/ Initialize Settings\r\npublic function initialize_settings() {\r\n\r\n$default_settings = array();\r\nforeach ( $this-&gt;settings as $id =&gt; $setting ) {\r\nif ( $setting['type'] != 'heading' )\r\n$default_settings[$id] = $setting['std'];\r\n}\r\nupdate_option( 'theme_settings', $default_settings );\r\n}\r\n\r\n\/\/ Register Settings\r\npublic function register_settings() {\r\n\r\nregister_setting( 'theme_settings', 'theme_settings', array ( &amp;$this, 'validate_settings' ) );\r\n\r\nforeach ( $this-&gt;sections as $slug =&gt; $title ) {\r\nadd_settings_section( $slug, $title, array( &amp;$this, 'display_section' ), 'theme-settings' );\r\n}\r\n\r\n$this-&gt;get_settings();\r\n\r\nforeach ( $this-&gt;settings as $id =&gt; $setting ) {\r\n$setting['id'] = $id;\r\n$this-&gt;create_setting( $setting );\r\n}\r\n}\r\n\r\n\/\/ jQuery Tabs\r\npublic function scripts() {\r\nwp_print_scripts( 'jquery-ui-tabs' );\r\n}\r\n\/\/ Styling for the theme options page\r\npublic function styles() {\r\n\r\nwp_register_style( 'admin', get_stylesheet_directory_uri() . '\/adminoptions\/admin.css' );\r\nwp_enqueue_style( 'admin' );\r\n\r\n}\r\n\r\n\/\/ Validate settings\r\npublic function validate_settings( $input ) {\r\n\r\nif ( ! isset( $input['reset_theme'] ) ) {\r\n$options = get_option( 'theme_settings' );\r\n\r\nforeach ( $this-&gt;checkboxes as $id ) {\r\nif ( isset( $options[$id] ) &amp;&amp; ! isset( $input[$id] ) )\r\nunset( $options[$id] );\r\n}\r\nreturn $input;\r\n}\r\nreturn false;\r\n\r\n}\r\n\r\n}\r\n$theme_options = new BR_Theme_Options();\r\nfunction mytheme_option( $option ) {\r\n$options = get_option( 'theme_settings' );\r\nif ( isset( $options[$option] ) )\r\nreturn $options[$option];\r\nelse\r\nreturn false;\r\n};\r\n<\/pre>\n<h3>admin.css<\/h3>\n<pre class=\"prettyprint\">.ui-tabs-nav {\r\n\r\n\tborder-bottom: 1px solid #ccc;\r\n\r\n\theight:29px;\r\n\r\n\tmargin: 20px 0;\r\n\r\n\tpadding: 0;\r\n\r\n}\r\n\r\n.ui-tabs-nav li {\r\n\r\n\tdisplay: block;\r\n\r\n\tfloat: left;\r\n\r\n\tmargin: 0;\r\n\r\n}\r\n\r\n.ui-tabs-nav li a {\r\n\r\n\tpadding: 4px 20px 6px;\r\n\r\n\tfont-weight: bold;\r\n\r\n}\r\n\r\n.ui-tabs-nav li a {\r\n\r\n\tborder-style: solid;\r\n\r\n\tborder-color: #CCC #CCC #f1f1f1;\r\n\r\n\tborder-width: 1px 1px 0;\r\n\r\n\tcolor: #676767;\r\n\r\n\ttext-shadow: rgba(255, 255, 255, 1) 0 1px 0;\r\n\r\n\tdisplay: inline-block;\r\n\r\n\tpadding: 4px 14px 6px;\r\n\r\n\ttext-decoration: none;\r\n\r\n\tmargin: 0 6px -1px 0;\r\n\r\n\t-moz-border-radius: 5px 5px 0 0;\r\n\r\n\t-webkit-border-top-left-radius: 5px;\r\n\r\n\t-webkit-border-top-right-radius: 5px;\r\n\r\n\t-khtml-border-top-left-radius: 5px;\r\n\r\n\t-khtml-border-top-right-radius: 5px;\r\n\r\n\tborder-top-left-radius: 5px;\r\n\r\n\tborder-top-right-radius: 5px;\r\n\r\n}\r\n\r\n.ui-tabs-nav li a:hover {color:#454545;}\r\n\r\n.ui-tabs-nav li a:focus {box-shadow:none;}\r\n\r\n.ui-tabs-nav li.ui-tabs-selected a,\r\n\r\n.ui-tabs-nav li.ui-state-active a {\r\n\r\n\tborder-width: 1px;\r\n\r\n\tcolor: #2e2e2e;\r\n\r\n}\r\n\r\n.ui-tabs-panel {\r\n\r\n\tclear: both;\r\n\r\n}\r\n\r\n.ui-tabs-panel h3 {\r\n\r\n\tfont: italic normal normal 24px\/29px \"Times New Roman\", Times, serif;\r\n\r\n\tmargin: 0;\r\n\r\n\tpadding: 0 0 5px;\r\n\r\n\tline-height: 35px;\r\n\r\n\ttext-shadow: 0 1px 0 #fff; \r\n\r\n}\r\n\r\n.ui-tabs-panel h4 {\r\n\r\n\tfont-size: 15px;\r\n\r\n\tfont-weight: bold;\r\n\r\n\tmargin: 1em 0;\r\n\r\n}\r\n\r\n.wrap h3, .wrap table {\r\n\r\n\tdisplay: none;\r\n\r\n}\r\n<\/pre>\n<h3>custom.css<\/h3>\n<pre class=\"prettyprint\">.tl {margin:.4em 0; font-weight:bold; text-indent:2px;}\r\n\r\n.fld {margin:0;}\r\n\r\n.inp {height:25px; width:95%;}\r\n\r\n.slc {width:95%;}\r\n\r\n.slmm {width:90px;}\r\n\r\n.sldd {width:65px;}\r\n\r\n.slyy {width:80px;}\r\n\r\n.col_13, .col_23, .col_14 {float:left; position:relative;}\r\n\r\n.col_23 {width:60%;}\r\n\r\n.col_13 {width:40%;}\r\n\r\n.col_14 {width:25%;}\r\n<\/pre>\n<p>Now you go to your theme main function.php file and paste the below code for enqueue function:<\/p>\n<h4>require get_template_directory() . &#8216;\/adminoptions\/admin-options.php&#8217;;<\/h4>\n<p><strong>After that, you need to copy and paste the below code for the Option active function into your function.php file<\/strong><\/p>\n<pre class=\"prettyprint\">\/\/  Options Active\r\nfunction options( $option ) {\r\n\t$options = get_option( 'theme_settings' );\r\n\tif ( isset( $options[$option] ) )\r\n\t\treturn $options[$option];\r\n\telse\r\n\t\treturn false;\r\n}\r\n<\/pre>\n<p><strong>Then you need to active logo upload option, so place the below code into your function file:<\/strong><\/p>\n<pre class=\"prettyprint\">\/\/=============LOGO Function====================\r\nfunction my_admin_scripts() {\r\nwp_enqueue_script('media-upload');\r\nwp_enqueue_script('thickbox');}\r\nfunction my_admin_styles() {\r\nwp_enqueue_style('thickbox');}\r\nif (isset($_GET['page']) &amp;&amp; $_GET['page'] == 'theme-settings') {\r\nadd_action('admin_print_scripts', 'my_admin_scripts');\r\nadd_action('admin_print_styles', 'my_admin_styles');\r\n}\r\n<\/pre>\n<p><strong>Finally, we show how to show your theme options value on your website, so go to your header.php file and open it after then place below code for theme options value<\/strong><\/p>\n<pre class=\"prettyprint\">\u00a0&lt;?php \r\nif (options('logo_options') !== '') { ; ?&gt;&lt;img src=\"&lt;?php echo options('logo_options') ; ?&gt;\"&gt;&lt;?php } else{ ; ?&gt;\r\n&lt;img src=\"&lt;?php bloginfo('template_url'); ?&gt;\/images\/logo.png\" alt=\"\" class=\"img-responsive\" \/&gt;\r\n&lt;?php };?&gt;\r\n<\/pre>\n<p>All are done!!!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5190\" src=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Simple-WordPress-Theme-Options-Page.png\" alt=\"How-To-Create-A-Simple-WordPress-Theme-Options-Page\" width=\"836\" height=\"564\" srcset=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Simple-WordPress-Theme-Options-Page.png 836w, https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Simple-WordPress-Theme-Options-Page-480x324.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 836px, 100vw\" \/><\/p>\n<p>If you enjoyed reading this article and have more questions please reach out to our\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/submitticket.php?step=2&amp;deptid=1\">support team<\/a>\u00a0via live chat or\u00a0<a href=\"mailto:support@cloudsurph.com\">email<\/a>\u00a0and we would be glad to help you. we provide server\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting<\/a>\u00a0for all types of need and we can even get your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">server<\/a>\u00a0up and running with the service of your choice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options. You can purchase your\u00a0hosting from Cloudsurph.com,\u00a0Cloudsurph hosting\u00a0is a reliable hosting option for business and personal projects. We offer insight and help on system configuration issues and code errors or bugs. As a WordPress Theme Developer [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":5188,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[153,146,155,154,156],"tags":[54,47,105,103,48,113],"class_list":["post-5187","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-theme-customization","category-wordpress","category-wordpress-theme","category-wp-custom-theme","category-wp-theme-options","tag-best-vps-hosting-server-maryland","tag-cheap-cloud-servers","tag-cheap-storage-server-hosting","tag-cheapest-vps","tag-dedicated-server-hosting-in-washington-d-c","tag-speed-test-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WordPress Settings API: Creating Custom Theme Options -<\/title>\n<meta name=\"description\" content=\"How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress Settings API: Creating Custom Theme Options -\" \/>\n<meta property=\"og:description\" content=\"How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudsurph Web Hosting Washington D.C.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CloudSurph\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-29T12:45:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-29T12:57:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cloudsurph\" \/>\n<meta name=\"twitter:site\" content=\"@Cloud_Surph\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rony\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/\"},\"author\":{\"name\":\"Rony\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\"},\"headline\":\"WordPress Settings API: Creating Custom Theme Options\",\"datePublished\":\"2022-06-29T12:45:42+00:00\",\"dateModified\":\"2022-06-29T12:57:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/\"},\"wordCount\":400,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg\",\"keywords\":[\"Best VPS hosting server Maryland\",\"Cheap Cloud Servers\",\"Cheap Storage Server Hosting\",\"Cheapest VPS\",\"Dedicated Server Hosting in Washington D.C\",\"Speed test VPS\"],\"articleSection\":[\"Theme Customization\",\"WordPress\",\"WordPress Theme\",\"WP Custom Theme\",\"WP Theme Options\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/\",\"name\":\"WordPress Settings API: Creating Custom Theme Options -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg\",\"datePublished\":\"2022-06-29T12:45:42+00:00\",\"dateModified\":\"2022-06-29T12:57:06+00:00\",\"description\":\"How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg\",\"width\":1600,\"height\":900},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-create-a-custom-theme-options-for-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudsurph.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress Settings API: Creating Custom Theme Options\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"name\":\"Cloudsurph Web Hosting Washington D.C.\",\"description\":\"Dedicated Server Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cloudsurph.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\",\"name\":\"CloudSurph Technology Solutions\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"width\":2348,\"height\":1692,\"caption\":\"CloudSurph Technology Solutions\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/CloudSurph\\\/\",\"https:\\\/\\\/x.com\\\/Cloud_Surph\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\",\"name\":\"Rony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"caption\":\"Rony\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cloudsurph\"],\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/author\\\/ron\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress Settings API: Creating Custom Theme Options -","description":"How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"WordPress Settings API: Creating Custom Theme Options -","og_description":"How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options.","og_url":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/","og_site_name":"Cloudsurph Web Hosting Washington D.C.","article_publisher":"https:\/\/www.facebook.com\/CloudSurph\/","article_published_time":"2022-06-29T12:45:42+00:00","article_modified_time":"2022-06-29T12:57:06+00:00","og_image":[{"width":1600,"height":900,"url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg","type":"image\/jpeg"}],"author":"Rony","twitter_card":"summary_large_image","twitter_creator":"@cloudsurph","twitter_site":"@Cloud_Surph","twitter_misc":{"Written by":"Rony","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/#article","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/"},"author":{"name":"Rony","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed"},"headline":"WordPress Settings API: Creating Custom Theme Options","datePublished":"2022-06-29T12:45:42+00:00","dateModified":"2022-06-29T12:57:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/"},"wordCount":400,"publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg","keywords":["Best VPS hosting server Maryland","Cheap Cloud Servers","Cheap Storage Server Hosting","Cheapest VPS","Dedicated Server Hosting in Washington D.C","Speed test VPS"],"articleSection":["Theme Customization","WordPress","WordPress Theme","WP Custom Theme","WP Theme Options"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/","url":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/","name":"WordPress Settings API: Creating Custom Theme Options -","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg","datePublished":"2022-06-29T12:45:42+00:00","dateModified":"2022-06-29T12:57:06+00:00","description":"How to Create a Custom Theme Options Page for WordPress? Using the WordPress Settings API to Create Custom Theme Options.","breadcrumb":{"@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/#primaryimage","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/06\/How-To-Create-A-Custom-Theme-Options-Page-For-WordPress.jpg","width":1600,"height":900},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudsurph.com\/how-to-create-a-custom-theme-options-for-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudsurph.com\/"},{"@type":"ListItem","position":2,"name":"WordPress Settings API: Creating Custom Theme Options"}]},{"@type":"WebSite","@id":"https:\/\/www.cloudsurph.com\/#website","url":"https:\/\/www.cloudsurph.com\/","name":"Cloudsurph Web Hosting Washington D.C.","description":"Dedicated Server Hosting","publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cloudsurph.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cloudsurph.com\/#organization","name":"CloudSurph Technology Solutions","url":"https:\/\/www.cloudsurph.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","width":2348,"height":1692,"caption":"CloudSurph Technology Solutions"},"image":{"@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CloudSurph\/","https:\/\/x.com\/Cloud_Surph"]},{"@type":"Person","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed","name":"Rony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","caption":"Rony"},"sameAs":["https:\/\/x.com\/cloudsurph"],"url":"https:\/\/www.cloudsurph.com\/author\/ron\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/comments?post=5187"}],"version-history":[{"count":4,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5187\/revisions"}],"predecessor-version":[{"id":5194,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5187\/revisions\/5194"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media\/5188"}],"wp:attachment":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media?parent=5187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/categories?post=5187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/tags?post=5187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}