How to make theme elements customizable in wordpress? -
in wordpress there's menu option called 'appeareances'. want add (e.g.) submenu 'header' there , able customize header within wordpress (administration page).
from understood have have 'functions.php' file in theme folder. in 'functions.php' file write this:
<?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function); ?>
of course adapted arguments (which i'm not entirely sure should since feel quite lost in this).
codex best friend ..
and codex say, if want add entry 'appearance'
menu , use
for appearance: add_submenu_page( 'themes.php', ... );
or adapted case :
add_submenu_page( 'themes.php', 'header', 'header', 'edit_theme_options', 'customize_header','my_callback');
but ..:
also see > add_theme_page()
like :
add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function );
quoting codex :
parameters
$page_title (string) (required) text displayed in title tags of page when menu selected
default: none
$menu_title (string) (required) text used menu
default: none
$capability (string) (required) capability required menu displayed user.
default: none
$menu_slug (string) (required) slug name refer menu (should unique menu).
default: none
$function (callback) (optional) function called output content page.
tl;dr version
all above said in general custom menu entries, in specific case of custom header, need use :
add_theme_support( 'custom-header' );
see details here : http://codex.wordpress.org/custom_headers
Comments
Post a Comment