How To Create A Theme Options Page For WordPress

1.Add Menu To WordPress Admin

When adding a menu to the WordPress admin screen you have loads of flexibility you have the option of adding brand new menu items or adding the menu as a sub menu.

To add a top level menu just use the following function add_menu_page().


Adding Datepicker to User Profile In admin

add_action( 'admin_enqueue_scripts', 'enqueue_date_picker' );

function enqueue_date_picker(){
		$js_url = get_bloginfo('template_url')."/js/Field_Date.js";
			array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'),
		wp_enqueue_style( 'jquery-ui-datepicker' ,'');

Charater count

<script type=’text/javascript’>
var maxLength=250;
function charLimit(el) {
    if (el.value.length > maxLength) return false;
    return true;
function characterCount(el) {
    var charCount = document.getElementById(‘charCount’);
    if (el.value.length > maxLength) el.value = el.value.substring(0,maxLength);
    if (charCount) charCount.innerHTML = maxLength – el.value.length;
    return true;

    <textarea onKeyPress=”return charLimit(this)” onKeyUp=”return characterCount(this)”  rows=”8″ cols=”40″></textarea>
<p><strong><span id=”charCount”>250</span></strong> more characters available.</p>