How To Add Custom Meta Box In A Post?

// my_custom_metabox_subheading function my_custom_metabox_subheading(){ add_meta_box('banner-subheading', 'Banner-Heading', 'meta_box_subheading', 'page', 'side', 'high'); } add_action('add_meta_boxes', 'my_custom_metabox_subheading'); function meta_box_subheading($post){ ?> Banner Sub-Heading:

Read More

How To Create Theme Options In Admin Panel?

/* custom theme options menu on the admin dashboard call get_option function for fetch the value. For Example: for receiving a value of facebook url get_option("facebook_url"); */ add_action('admin_menu', 'my_theme_options'); function my_theme_options(){ add_menu_page( "Theme options", "Theme options", "manage_options", "theme-options", "my_theme_option_functions", "dashicons-category" ); } function my_theme_option_functions(){ ?> Theme Options Panel

Read More

How To Add Theme Customization Section?

/*custom theme customize options call get_theme_mod function for fetch the value. For Example: for receiving a value of heading get_theme_mod("custom_theme_customize_setting"); */ function custom_theme_customize_options($wp_customize){ $wp_customize->add_section("custom_theme_customize_area", array( "title"=> "Custom Theme Settings" )); $wp_customize->add_setting("custom_theme_customize_setting", array( "default"=> "Tested By Prashant Kansal" )); $wp_customize->add_control("custom_theme_customize_control", array( "label"=> "Enter Heading", "section"=> "custom_theme_customize_area", "settings"=> "custom_theme_customize_setting" )); } add_action('customize_register', 'custom_theme_customize_options');

Read More

Create Custom Menu In Wordpress

function clean_custom_menus() { $menu_name = 'top'; // specify custom menu slug if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])) { $menu = wp_get_nav_menu_object($locations[$menu_name]); $menu_items = wp_get_nav_menu_items($menu->term_id);//echo '<pre>'; //print_r($menu_items); //$menu_list = '<nav>' ."\n"; $menu_list .= '<ul class="nav navbar-nav">'; $count = 0; $submenu = false; foreach( $menu_items as $menu_item ) { $link = $menu_item->url; $title = $menu_item->title; if ( …

Read More