Home Blog Create a Select Menu With Hidden Divs From an Array With PHP

Create a Select Menu With Hidden Divs From an Array With PHP

0
Hidden jQuery Select Menu

As an alternative to using tabs, and as a genuine means of returning selective content on WordPress pages, we’ll often use a select menu to return various types of hidden content to a page. If you’re using our client plugin you’ll be familiar with the experience since we’ll routinely show the select menu as an alternative to tabs when the content itself is returned via a tab.

The result of our simple function is as follows (select a new option):

  This is the content in the entry DIV.

The PHP Function

You will want to alter the following function to suit your own purpose.

The function requires an array of data that includes the select menu titles and the DIV content. The array we used in our example is as follows:

If you were to use our example function you would return the menu with the following:

The jQuery function negates the need to include laborious if/else statements… so it doesn’t matter how many block of content you wish to return; whatever is provided via the array will be rendered into your menu.

Download

Our example above may be downloaded below.

Title: Select Menu With Hidden Divs
Description: Create a Select Menu With Hidden Divs From an Array With PHP. Working example.
Download: PHP Code (V0.1) | Plugin Page

■ ■ ■

Interested in WordPress and Web Design? Subscribe to our list and we'll send you subscriber-only tools and plugins

Short URL for this post: http://shor.tt/Joy

LEAVE A REPLY

Please enter your comment!
Please enter your name here