Create simple WordPress admin panel


Hello all, it’s been along time i am not create post. hahahha…..

Cause many thing i must finished, ok for now i will explain how to make a simple WordPress admin panel.

Maybe this post will be useful for the user to make their own WordPress themes with the admin panel.

We can put all option to control our Themes from the Admin panel, such as put the option to upload and select logo.

We can use all class in WordPress to make a layout for our Admin panel, and add some style to make tab or accordion effect.

First, lets make the function.php


//register settings
function theme_settings_init(){
register_setting( 'theme_settings', 'theme_settings' );
}

//add settings page to menu
function add_settings_page() {

add_menu_page( __( Your theme name .' Theme Settings' ), __( Your theme name .' Theme Settings' ), 'manage_options', 'settings', 'theme_settings_page');
}

//add actions
add_action( 'admin_init', 'theme_settings_init' );
add_action( 'admin_menu', 'add_settings_page' );

function theme_settings_page() {}

Put that’s script to your function.php, and you will find at the bottom of your dashboard, your theme panel.

then put your option of your themes to the function theme_settings_page().

You can see this one, i will give you the example.

<?php function theme_settings_page() {
?>
<div>
<div id="icon-options-general"></div>
<h2><?php _e( ' Theme Options' ) //your admin panel title ?></h2>
<ul>
<li>View Documentation  |</li>
<li>Visit Support </li>
</ul>
<p>
<span>Theme version</span>
</p>
<div>
<p>This theme was made by <a title="anang pratika" href="https://anangpratika.wordpress.com" target="_blank" >Anang Pratika</a>.</p>
</div>
</div>
<?php
}?>

Ok, finish…you will see the header at your admin panel. And for the next you can put any option in your admin like that.

If you have question or have some suggestion, feel free for leave the comment.

Let’s be a creative…heheheh

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s