1. Amyth Singh
  2. Myth Admin Framework

Overview

Myth Admin Framework

Myth Admin Framework - Wordpress Theme Admin Framework

Introduction

Myth Admin Framework is a wordpress theme admin framework that will help you setup your own theme's admin panel in less than 5 mins. It is as easy as copying a folder to your wordpress theme directory, renaming a few variables and that's it. It is just a few click before you can have your own professional jQuery and AJAX powered theme admin panel.

Requirements

  • Wordpress 3.4+
  • Basic knowledge of PHP
  • Basic knowledge of Wordpress Theme Development

Installation

  • First of all clone the directory under your wordpress themes directory using this command : git clone https://amyth@bitbucket.org/amyth/myth-admin-framework.git.
  • This will create a folder named myth-admin-framework under the themes directory.
  • Rename the folder to whatever you want to name your theme.
  • Open up style.css in a text editor and edit the following information according to your needs (as you generally do when you create a new theme).

    Theme Name:
    Theme URI:
    Author:
    Author URI:
    Description:
    Version:
    License:
    License URI:
    Tags:
    Text Domain:
    
  • Now open up the file mythadmin/mythadmin.php and update the information inside $config dictionary.

    public $config = array(
        'themename' => 'Test Theme', // Name of your theme
        'themefoldername' => 'foldername', // your theme's foldername (exact)
        'themever' => '1.0.1', // Version of your theme
        'shortname' => 'myth', // Shortname of your theme
        'cssprefix' => 'myth_', // This is the CSS prefix of your theme
        'menus' => array('Main Menu', 'Top Bar Menu', 'Footer Menu'), // Add or Remove Menus according to your needs here.
        'widgets' => array('Homepage Sidebar', 'Blog Sidebar'), // Add or Remove Widget Areas according to your needs here.
        'admin_page_title' => 'Myth Admin', // The Title of the Theme Admin page.
        'admin_menu_icon' => '/myth-admin-framework/mythadmin/images/mythadminicon.png', // Icon of your theme (16x16)
    );
    
  • Now the Final Step, Define Option Categories, Subcategories and options under $themeopts dictionary.

    public $config = array(
        'Category' => array(
            'Sub Category' => array(
                array(), // Option Here
                array(), // Another Option
                array(), // Yet another option
            )
        )
    );
    
  • You can have unlimited categories, sub categories and options. Following you can find a list of type of options provided.

Option Types Available

  • text : A simple text field option

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id_of_option',
        'type' => 'text',
        'val' => 'Initial Value'
    )
    
  • color : A Colorpicker field

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id',
        'type' => 'color',
        'val' => 'ffffff' // Initial Value.
    )
    
  • select : A dropdown/select option

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id',
        'type' => 'select',
        'options'=>array('opt1','opt2','opt3','opt4'), // Define Available options here
        'val' => 'opt1' // Initial Value.
    )
    
  • onoff : A simple on/off button can be as a checkbox

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id',
        'type' => 'onoff',
        'val' => 'checked' // Initial Value.
    )
    
  • yesno : A simple yes/no button, just like an on/off button but with a Yes or a No label.

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id',
        'type' => 'yesno',
        'val' => 'checked' // Initial Value.
    )
    
  • slider : A slider bar option, can be used to choose a number within a range. For Example : height, width, amount etc.

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id',
        'type' => 'slider',
        'min' => 0, // Minimum Value
        'max' => 50, // Maximum Value
        'step' => 5, // Step to Jump while Sliding
        'val_label' => '$' // Suffix to show after the numeric value, for example 'px' will display `10 px`
        'val' => 'checked'
    )
    
  • textarea : A simple textarea field for large amount of text.

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id',
        'type' => 'textarea',
        'val' => '' // Initial Value.
    )
    
  • file : A simple Image / Media uploader field that uses wordpress' builtin media uploader

    array(
        'name' => 'Name of the Option',
        'id' => 'unique_id',
        'type' => 'file',
        'upload_title' => 'Upload File' // This is the Title of the Upload Button
        'val' => '', // Initial Value.
    )
    

Contributions

Licenses