Archives
jquery accordion
Creating a Dynamic JQuery
Accordion for WordPress
Setting up the backend
The goal of this tutorial is to create a fancy dynamic jquery accordion that you can access from your wordpress theme. This is great for FAQ pages or any page with lots of content.
Step 1. Download wpalchemy from http://www.farinspace.com/wpalchemy-metabox/#download
Wpalchemy will help us create our custom metabox quickly. Once you have the latest files place the two wpalchemy files into your theme’s folder.
Next navigate to the theme’s folder. For this demo I will be using the twentyeleven theme as an example… We will start creating the metabox by first going to the theme’s functions.php
Here, at the end of the function.php we will need to add a few lines of code to initiate the wonderful code provided by wpalchemy. Here is what we need to add:
// include the class in your theme or plugin
include_once 'MetaBox.php';
include_once 'MediaAccess.php';
// include css to help style our custom meta boxes
if (is_admin()) { wp_enqueue_style('custom_meta_css',
get_bloginfo('stylesheet_directory') . '/metabox/meta.css'); }
$wpalchemy_media_access = new WPALchemy_MediaAccess();
$custom_metabox = new WPAlchemy_MetaBox(array
(
'id' => '_custom_meta',
'title' => 'Add Accordion',
'template' => STYLESHEETPATH . '/metabox/accordion.php',
)
);
The first line two lines call the MetaBox.php and MediaAccess.php which are needed to run the metabox… Read More
10/18/11 by Miles

