Home > theme customizer > How can I create a sub menu for sections (customization page)?

How can I create a sub menu for sections (customization page)?

November 30Hits:0
Advertisement

One of the cool new features of WordPress 4.0 is the add_panel() method. In my situation, i'd like to create a new panel for theme options, that's very straight forward, but is it possible to create sub panels under the them options panel, for example one for the header, one for body and one for the footer? If so, how would I go about doing it?

Answers

You create Panels, and put Sections inside those Panels.

So if you have your panel:

$wp_customize->add_panel( 'panel_id', array(
 'priority'       => 10,
  'capability'     => 'edit_theme_options',
  'theme_supports' => '',
  'title'          => __('Theme Options', 'mytheme'),
  'description'    => __('Several settings pertaining my theme', 'mytheme'),
) );

Then you need to add your sections:

$wp_customize->add_section( 'header_settings', array(
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
    'title'          => __('Header Settings', 'mytheme'),
    'description'    =>  __('Header elements configuration', 'mytheme'),
    'panel'  => 'panel_id',
) );

$wp_customize->add_section( 'footer_settings', array(
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
    'title'          => __('Footer Settings', 'mytheme'),
    'description'    =>  __('Footer elements configuration', 'mytheme'),
    'panel'  => 'panel_id',
) );

Regular sections are "sub" panels. Then you add your settings to your sections, and you are done.

Related Articles

  • How can I create a sub menu for sections (customization page)? November 30

    One of the cool new features of WordPress 4.0 is the add_panel() method. In my situation, i'd like to create a new panel for theme options, that's very straight forward, but is it possible to create sub panels under the them options panel, for exampl

  • create drop down menu in theme customizer from custom dbJuly 31

    what i am trying to do is create drop down menu in theme customizer from custom db i have created. db name "students". in the db i have only the id and the name. i want to show all students names in the drop down menu. and when the user will cho

  • I installed Haiku on my Windows 7 machine. How do I create a boot menu?February 12

    I just installed Haiku on my Windows 7 laptop, and I don't know how to create a boot menu. I had BeOS running a few years ago, and that came with one built-in. I know my way around computers enough to mess around with partitions and whatnot, but my r

  • Creating a custom menuAugust 30

    I want to create a custom menu in the style below, can this be done? The code in brackets needs to grab the actual page content for each page. <div class="menu-button-(page-name)"> <a href="(page-link)">(page-name)</a>

  • How to use wp_nav_menu to create a select menu dropdown?September 1

    I'm using the following inside the wp_nav_menu function to create a select dropdown menu where each menu item is an option in the select dropdown... 'items_wrap' => '<select>%3$s</select>' 'before' => '<option value="">'

  • Create New Admin Menu Section - Like how custom post type works, in a wayOctober 7

    I've been working with Wordpress off and on for years now, but I haven't gotten entirely immersed with the framework. I have no problem creating plugins that use custom post types, but I'm looking to add a new section in the admin that isn't for post

  • How to Create a Flashy Menu Using CSS

    How to Create a Flashy Menu Using CSSFebruary 8

    Today I'm going to show you how to create a flashy menu using CSS3. This tutorial is for beginners and can be completed fairly quickly. Make sure you click on the link below to see a demo of the menu and get the source code. Download the Demo & Sourc

  • Create a footer menu from primary links and should be able to control what should appear

    Create a footer menu from primary links and should be able to control what should appearJune 14

    I have a menu at the top on hover it expands. I want a menu at bottom of page with same links, but i may choose what should appear here. Is there any module available for it. --------------Solutions------------- You need a region in footer, of course

  • Creating new dynamic menu including BP links July 31

    Perhaps I have missed something fundamental, but I am attempting to include the various dynamic menu items included with BuddyPress and other add-ons to my primary drop-down menu. For example, the Twenty Eleven WP theme has a tall header with a drop-

  • Creating Transparent Game Menu Items using AndEngineNovember 18

    I'm trying to create a Game Menu which contains some Menu Items like New Game Multiplayer Options Exit I want to make this Menu Items Transparent. Only Text in White color should be visible. So i guess i do not need any background image for Menu Item

  • How can I create a dropdown menu of child pages from Structure?November 26

    I would like to have a select menu for the child pages of a page in a site using the Structure plugin. However some of the pages don't have child pages so they wouldn't need the select menu to display. a) How do I create the select menu so that you w

  • Creating a custom menu/widget areaDecember 9

    I'm looking to create a /menu/widget area like the following site: http://www.microsoft.com/en-gb/default.aspx please see sections under downloads, security, support, about is this considered a footer menu as well? my theme's footer menu is just a st

  • creating a UI menu in c++February 28

    Im currently working on a 2D Game where the users can interact with specific nodes and are able to edit certain bits of information and I also plan for the users to be able to click buttons to set specific information. My problem is that I do not kno

  • How to create a category menu?March 21

    I am new in WordPress world (before now I always used Joomla and some other old CMS) Now I am testing WordPress and I have some doubts about how create a navigation menu in my WP Site. This is my test site (that at this time have not content but only

  • Windows 8 - new programs don't create Explorer context menu entries

    Windows 8 - new programs don't create Explorer context menu entriesMarch 27

    I have a bunch of older Windows XP programs. When I install them, they used to create right-click context menu entries in Explorer, but in Windows 8 64bit they don't seem to be doing that anymore. I've read a few superuser questions and forum entries

  • Spacing, subfigures and right captions (Creating a bar menu)

    Spacing, subfigures and right captions (Creating a bar menu)April 12

    I am trying to create a bar menu for a student place I am part of. Now since we are studying CS, mathematics and or physics of course he have to use latex to create our barmenus or drinking lists. An example of a page is given below Now the question

  • How to create dynamic sub-menu in ArcMap?

    How to create dynamic sub-menu in ArcMap?April 21

    I created a static menu contains 3 static items like in this link create menus, I want to add a sub-menu and get the menu's items from database like in this image: I already did the left part with static items, but i couldn't add the sub-menu like in

  • add LibreOffice to Nautilus right click `create new document` menu

    add LibreOffice to Nautilus right click `create new document` menuMay 30

    How do I add LibreOffice word processing to the options on the Nautilus right click create new document menu? I'm on 12.04. --------------Solutions------------- The "Create new document" dialog sources its entries from ~/Templates. Simply put an

  • How to quickly create a dummy menu?August 22

    I want to create a dummy menu with 1 or 2 level of depth. I know I can create the menu via the administration module, but I want to know if there is something I can use to generate fast a dummy menu. I have a file with the sitemap indented by spaces

  • Review of a jQuery plugin that helps create a responsive MenuAugust 28

    I've just launched my first project on GitHub. It's a jQuery plugin that helps create a responsive menu. It deals with interactivity (essentially using toggle and some classes), and leaves all the presentation stuff for CSS. Here is the basics for us

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.906 s.