'Video Content', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'only_on' => array( 'template' => array( 'video-page-template.php' ), ), 'fields' => array( array( 'name' => 'video column 1', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 1 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 2', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 2 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 3', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 3 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 4', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 4 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), ) ); //meta stuffs $meta_boxes[] = array( 'title' => 'Link URL', 'pages' => array('boxouts','page-furniture'), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'video column 1', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 1 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 2', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 2 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 3', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 3 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 4', 'id' => $prefix . 'videocol1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), array( 'name' => 'video column 4 description', 'id' => $prefix . 'videocoldesc1', 'type' => 'wysiwyg', 'desc' => 'Enter the video content (embed code from youtube)' ), ) ); //meta stuffs $meta_boxes[] = array( 'title' => 'Playlists', 'pages' => array('videochannels'), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'playlist code', 'id' => $prefix . 'playlist', 'type' => 'text', 'desc' => 'Enter the playlist code' ), ) ); //meta stuffs $meta_boxes[] = array( 'title' => 'Extra Content', 'pages' => array('page','apprentices','employers','aboutus','videochannels','learning-resources'), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'anchor1header', 'id' => $prefix . 'anchor1header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor1', 'id' => $prefix . 'anchor1', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor2header', 'id' => $prefix . 'anchor2header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor2', 'id' => $prefix . 'anchor2', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor3header', 'id' => $prefix . 'anchor3header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor3', 'id' => $prefix . 'anchor3', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor4header', 'id' => $prefix . 'anchor4header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor4', 'id' => $prefix . 'anchor4', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor5header', 'id' => $prefix . 'anchor5header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor5', 'id' => $prefix . 'anchor5', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor6header', 'id' => $prefix . 'anchor6header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor6', 'id' => $prefix . 'anchor6', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor7header', 'id' => $prefix . 'anchor7header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor7', 'id' => $prefix . 'anchor7', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor8header', 'id' => $prefix . 'anchor8header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor8', 'id' => $prefix . 'anchor8', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor9header', 'id' => $prefix . 'anchor9header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor9', 'id' => $prefix . 'anchor9', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor10header', 'id' => $prefix . 'anchor10header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor10', 'id' => $prefix . 'anchor10', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor11header', 'id' => $prefix . 'anchor11header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor11', 'id' => $prefix . 'anchor11', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor12header', 'id' => $prefix . 'anchor12header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor12', 'id' => $prefix . 'anchor12', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor13header', 'id' => $prefix . 'anchor13header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor13', 'id' => $prefix . 'anchor13', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor14header', 'id' => $prefix . 'anchor14header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor14', 'id' => $prefix . 'anchor14', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor15header', 'id' => $prefix . 'anchor15header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor15', 'id' => $prefix . 'anchor15', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor16header', 'id' => $prefix . 'anchor16header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor16', 'id' => $prefix . 'anchor16', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor17header', 'id' => $prefix . 'anchor17header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor17', 'id' => $prefix . 'anchor17', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor18header', 'id' => $prefix . 'anchor18header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor18', 'id' => $prefix . 'anchor18', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor19header', 'id' => $prefix . 'anchor19header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor19', 'id' => $prefix . 'anchor19', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), array( 'name' => 'anchor20header', 'id' => $prefix . 'anchor20header', 'type' => 'text', 'desc' => 'Enter the sub menu title' ), array( 'name' => 'anchor20', 'id' => $prefix . 'anchor20', 'type' => 'wysiwyg', 'desc' => 'Enter the content to be automatically scrolled to' ), ) ); // meta stuffs $meta_boxes[] = array( 'title' => 'Job Detail', 'pages' => array('jobs'), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Job ID', 'id' => $prefix . 'jobid', 'type' => 'text', 'desc' => 'Job ID' ), array( 'name' => 'Job Name', 'id' => $prefix . 'jobname', 'type' => 'text', 'desc' => 'Job Name' ), array( 'name' => 'Company Name', 'id' => $prefix . 'companyname', 'type' => 'text', 'desc' => 'Company Name' ), array( 'name' => 'Location', 'id' => $prefix . 'location', 'type' => 'text', 'desc' => 'Location' ), array( 'name' => 'City', 'id' => $prefix . 'city', 'type' => 'text', 'desc' => 'City' ) ,array( 'name' => 'State', 'id' => $prefix . 'state', 'type' => 'text', 'desc' => 'State' ) ,array( 'name' => 'Short Description', 'id' => $prefix . 'shortdescription', 'type' => 'wysiwyg', 'desc' => 'Short Description' ) ,array( 'name' => 'Long Description', 'id' => $prefix . 'longtdescription', 'type' => 'wysiwyg', 'desc' => 'Long Description' ) ,array( 'name' => 'Requirements', 'id' => $prefix . 'requirements', 'type' => 'wysiwyg', 'desc' => 'Requirements' ) ,array( 'name' => 'Salary', 'id' => $prefix . 'salary', 'type' => 'text', 'desc' => 'Salary' ) ) ); // meta stuffs $meta_boxes[] = array( 'title' => 'Questions and Answers', 'pages' => array('faqs'), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Question', 'id' => $prefix . 'question', 'type' => 'wysiwyg', 'desc' => 'Question' ), array( 'name' => 'Answer', 'id' => $prefix . 'answer', 'type' => 'wysiwyg', 'desc' => 'Answer' ) ) ); // meta stuffs $meta_boxes[] = array( 'title' => 'Address Info', 'pages' => array('locations'), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Address', 'id' => $prefix . 'address', 'type' => 'wysiwyg', 'desc' => 'Address' ), array( 'name' => 'Telephone', 'id' => $prefix . 'telephone', 'type' => 'text', 'desc' => 'Telephone' ), array( 'name' => 'Fax', 'id' => $prefix . 'fax', 'type' => 'text', 'desc' => 'Fax' ) ,array( 'name' => 'Email', 'id' => $prefix . 'email', 'type' => 'email', 'desc' => 'Email' ) ) ); // meta stuffs $meta_boxes[] = array( 'title' => 'Video Info', 'pages' => array('videos'), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Video ID', 'id' => $prefix . 'videoid', 'type' => 'text', 'desc' => 'You Tube Video ID ie. G7z74BvLWUg' ), array( 'name' => 'Thumbnail Image', 'id' => $prefix . 'thumbnailimage', 'type' => 'image', 'desc' => 'Video Screenshot image - should be 220 x 120 pixels' ), array( 'name' => 'Video Description', 'id' => $prefix . 'videodescription', 'type' => 'wysiwyg', 'desc' => 'Video Description Text' ), ) ); function rw_register_meta_boxes() { global $meta_boxes; // Make sure there's no errors when the plugin is deactivated or during upgrade if ( !class_exists( 'RW_Meta_Box' ) ) return; foreach ( $meta_boxes as $meta_box ) { if(isset($meta_box['only_on']) && !rw_maybe_include($meta_box['only_on'])) continue; new RW_Meta_Box( $meta_box ); } } add_action( 'admin_init', 'rw_register_meta_boxes' ); /** * Check if meta boxes is included * * @return bool */ function rw_maybe_include($conditions) { // Include in back-end only if ( !defined( 'WP_ADMIN' ) || !WP_ADMIN ) return false; // Always include for ajax if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) return true; if ( isset( $_GET['post'] ) ) $post_id = $_GET['post']; elseif ( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID']; else $post_id = false; $post_id = (int) $post_id; foreach($conditions as $cond => $v){ //catch non-arrays too if(!is_array($v)) $v = array($v); switch($cond){ case 'id': if ( in_array( $post_id, $v )) return true; break; case 'slug': $post = get_post($post_id); $post_slug = $post->post_name; if ( in_array( $post_slug, $v )) return true; break; case 'template': $template = get_post_meta( $post_id, '_wp_page_template', true ); if ( in_array( $template, $v ) ) return true; break; } } // If no condition matched return false; } _x('Quotations', 'post type general name'), 'singular_name' => _x('Quotation', 'post type singular name'), 'add_new' => _x('Add New', 'Quotation'), 'add_new_item' => __('Add New Quotation'), 'edit_item' => __('Edit Quotation'), 'new_item' => __('New Quotation'), 'view_item' => __('View Quotations'), 'search_items' => __('Search Quotations'), 'not_found' => __('No Quotations Found'), 'not_found_in_trash' => __('No Quotations found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Quotations', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => Array('slug'=>'quotations'), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => true, 'menu_position' => 39, 'supports' => array('title','editor', 'excerpt','thumbnail', 'page-attributes', 'custom-fields','post-formats') ); register_post_type('quotations',$args); // Subjects $labels = array( 'name' => _x('Learning Resources', 'post type general name'), 'singular_name' => _x('Learning Resources', 'post type singular name'), 'add_new' => _x('Add New', 'Learning Resource'), 'add_new_item' => __('Add New Learning Resource'), 'edit_item' => __('Edit Learning Resource'), 'new_item' => __('New Learning Resource'), 'view_item' => __('View Learning Resources'), 'search_items' => __('Search Learning Resources'), 'not_found' => __('No Learning Resources Found'), 'not_found_in_trash' => __('No Learning Resources found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Learning Resources', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => Array('slug'=>'learning-resources'), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => true, 'menu_position' => 40, 'supports' => array('title','editor', 'excerpt','thumbnail', 'page-attributes', 'custom-fields','post-formats') ); register_post_type('learningresources',$args); // Downloads $labels = array( 'name' => _x('Downloads', 'post type general name'), 'singular_name' => _x('Download', 'post type singular name'), 'add_new' => _x('Add New', 'Download'), 'add_new_item' => __('Add New Download'), 'edit_item' => __('Edit Download'), 'new_item' => __('New Download'), 'view_item' => __('View Downloads'), 'search_items' => __('Search Downloads'), 'not_found' => __('No Downloads Found'), 'not_found_in_trash' => __('No Downloads found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Downloads', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => Array('slug'=>'downloads'), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => true, 'menu_position' => 41, 'supports' => array('title','editor', 'excerpt','thumbnail', 'page-attributes', 'custom-fields','post-formats') ); register_post_type('downloads',$args); // Video Channels $labels = array( 'name' => _x('Video Channels', 'post type general name'), 'singular_name' => _x('Video Channel', 'post type singular name'), 'add_new' => _x('Add New', 'Video Channel'), 'add_new_item' => __('Add New Video Channel'), 'edit_item' => __('Edit Video Channel'), 'new_item' => __('New Video Channel'), 'view_item' => __('View Video Channel'), 'search_items' => __('Search Video Channels'), 'not_found' => __('No Video Channels Found'), 'not_found_in_trash' => __('No Video Channels found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Video Channels', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => Array('slug'=>'video-channels'), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => true, 'menu_position' => 42, 'supports' => array('title','editor', 'excerpt','thumbnail', 'page-attributes', 'custom-fields') ); register_post_type('videochannels',$args); // About Us $labels = array( 'name' => _x('About us', 'post type general name'), 'singular_name' => _x('About us', 'post type singular name'), 'add_new' => _x('Add New', 'About us Page'), 'add_new_item' => __('Add New About us Page'), 'edit_item' => __('Edit About us Page'), 'new_item' => __('New About us Page'), 'view_item' => __('View About us Page'), 'search_items' => __('Search About us Pages'), 'not_found' => __('No About us Pages found'), 'not_found_in_trash' => __('No About us Pages found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'About us Pages', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => Array('slug'=>'about-us'), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => true, 'menu_position' => 43, 'supports' => array('title','editor', 'excerpt','thumbnail', 'page-attributes', 'custom-fields') ); register_post_type('aboutus',$args); // Page Furniture Post Type $labels = array( 'name' => _x('Page furniture', 'post type general name'), 'singular_name' => _x('Page furnitures', 'post type singular name'), 'add_new' => _x('Add New', 'Page furniture'), 'add_new_item' => __('Add New Page furniture'), 'edit_item' => __('Edit Page furniture'), 'new_item' => __('New Page furniture'), 'view_item' => __('View Page furniture'), 'search_items' => __('Search Page furniture'), 'not_found' => __('No Page furniture found'), 'not_found_in_trash' => __('No Page furniture found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Page Furniture', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => Array('slug'=>'page-furniture'), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => 44, 'supports' => array('title','editor', 'excerpt','thumbnail', 'page-attributes', 'custom-fields') ); register_post_type('page-furniture',$args); // Testimonial Post Type $labels = array( 'name' => _x('Testimonials', 'post type general name'), 'singular_name' => _x('Testimonial', 'post type singular name'), 'add_new' => _x('Add New', 'Testimonial'), 'add_new_item' => __('Add New Testimonial'), 'edit_item' => __('Edit Testimonial'), 'new_item' => __('New Testimonial'), 'view_item' => __('View Testimonial'), 'search_items' => __('Search Testimonials'), 'not_found' => __('No Testimonials found'), 'not_found_in_trash' => __('No Testimonials found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Testimonials' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => Array('slug'=>'testimonials'), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => 45, 'supports' => array('title','editor','revisions', 'author','excerpt','thumbnail', 'page-attributes') ); register_post_type('testimonials',$args); // VIDEOS $labels = array( 'name' => _x('Videos', 'post type general name'), 'singular_name' => _x('Video', 'post type singular name'), 'add_new' => _x('Add New', 'Video'), 'add_new_item' => __('Add New Video'), 'edit_item' => __('Edit Video'), 'new_item' => __('New Video'), 'view_item' => __('View Videos'), 'search_items' => __('Search Videos'), 'not_found' => __('No Video'), 'not_found_in_trash' => __('No Video found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Videos', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => Array('slug'=>'videos'), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => 46, 'supports' => array('title','revisions', 'author','excerpt','thumbnail', 'page-attributes') ); register_post_type('videos',$args); } true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'public' => true, 'label' => __('Learning Category'), 'show_in_nav_menus' => true, 'labels' => array( 'add_new_item' => 'Add New Learning Category' ), 'query_var' => true, ) ); register_taxonomy( 'video-category', array( 'videos' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'public' => true, 'label' => __('Video Category'), 'show_in_nav_menus' => true, 'labels' => array( 'add_new_item' => 'Add New Video Category' ), 'query_var' => true, ) ); register_taxonomy( 'testimonial-category', array( 'testimonials' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'public' => true, 'label' => __('Testimonial Category'), 'show_in_nav_menus' => false, 'labels' => array( 'add_new_item' => 'Add New Testimonial Category' ), 'query_var' => true, ) ); register_taxonomy( 'page-furniture-category', array( 'page-furniture' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'public' => true, 'label' => __('Page furniture Category'), 'show_in_nav_menus' => false, 'labels' => array( 'add_new_item' => 'Add New Page Furniture Category' ), 'query_var' => true, ) ); register_taxonomy( 'expertise-category', array( 'publications','industrysector','practicearea','people','expertise-area','experience-item','director' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'label' => __('Expertise Category'), 'show_in_nav_menus' => true, 'labels' => array( 'add_new_item' => 'Add New Expertise Category' ), 'query_var' => true, ) ); register_taxonomy( 'location', array( 'people','locations','director' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'label' => __('Location'), 'show_in_nav_menus' => true, 'labels' => array( 'add_new_item' => 'Add New Location' ), 'query_var' => true, ) ); register_taxonomy( 'teamrole', array( 'people','locations','director' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'label' => __('Team Role'), 'show_in_nav_menus' => true, 'labels' => array( 'add_new_item' => 'Add New Team Role' ), 'query_var' => true, ) ); register_taxonomy( 'state', array( 'people','locations','director' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'label' => __('State'), 'show_in_nav_menus' => true, 'labels' => array( 'add_new_item' => 'Add New State' ), 'query_var' => true, ) ); register_taxonomy( 'clientlogo-category', array( 'clientlogo' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'public' => true, 'label' => __('Client Logo Category'), 'show_in_nav_menus' => false, 'labels' => array( 'add_new_item' => 'Add New Client Logo Category' ), 'query_var' => true, ) );register_taxonomy( 'boxout-position', array( 'boxouts' ), array( 'hierarchical' => true, 'show_ui' => true, 'public' => true, 'show_admin_column' => true, 'public' => true, 'label' => __('Boxout Position'), 'show_in_nav_menus' => false, 'labels' => array( 'add_new_item' => 'Add New Boxout Position' ), 'query_var' => true, ) ); Pascal’s Triangle | Crystal Clear Mathematics
bannerabout
graemethin
bannerdive
graemethin2

Sign up to my Newsletter

EASIER THAN YOU THINK...
'; elseif(is_search('publications') ) : echo 'style="width:690px;margin-left:0px;">'; elseif (is_page(array('Testimonials','Quotations')) ) : echo 'style="margin:0px;">'; elseif(is_home()) : echo 'class="blogposts">'; else : echo'>'; endif; // ADD ENTRY TAG echo '
'; else : // EVERY OTHER PAGE echo'">'; endif; ?>

Pascal’s Triangle

Pascal's TriangleThis amazing triangle is named after Blaise Pascal (1623-1662), the French mathematician who studied it at length and published what is probably the first mathematical treatise devoted specifically to an analysis of it. His famous work, Traité du triangle arithmétique (Treatise on the Arithmetic Triangle) was published posthumously in 1665 … although it was likely written in late 1654 (some say 1653) during the time he was corresponding with Pierre de Fermat concerning early probability theory.  You will discover that this triangle is very useful in analysing probabilities.

What we have come to call Pascal’s Triangle has a very long history, however. It was known at least 1500 years before Pascal and is referred to as the Khayyam triangle in Iran, Yang Hui’s Triangle in China, and Tartaglia’s Triangle in Italy.

If you wish to learn about a wide range of properties that this wonderful triangle has, then I suggest you visit the Maths is Fun website for a comprehensive summary.  In time, I will be discussing these properties on this page.  I spent many very happy hours studying this triangle during my high school years!

A Brief History of Pascal's Triangle

India

The triangle, and the means of constructing it (by adding the two terms above) were known by Pingala about two thousand years ago. He wrote the Chandaḥśāstra (also known as the Chandaḥsūtra), which was a study of metre in Sanskrit poetry. His discussion of light (laghu) and heavy (guru) syllables led him to a discussion of binary arithmetic. This corresponds to the binomial theorem upon which Pascal's Triangle is based.

Centuries later, the Indian astronomer and mathematician, Varāhamihira (505–587) also discussed the triangle and its additive properties.  About 300 years later, about 850, the Jain mathematician Mahāvīra produced a means of generating the binomial coefficients by using multiplication.  There are claims that his method is equivalent to the modern binomial formula which uses factorial notation.  And, during the tenth century, another Indian mathematician, Halayudha, provides us with a description of this triangle which he calls Meru-prastaara (the Staircase of Mount Meru). It is through his commentary on Pingala's Chandaḥśāstra that we know of Pingala's use of Pascal's Triangle.

Persia (Iran)

The Persian mathematician, Al-Karaji (953–1029) wrote about Pascal's Triangle and the binomial theorem.  A century later, the poet-astronomer-mathematician Omar Khayyám (1048–1131) also discussed Pascal's Triangle in his famous Treatise on Demonstration of Problems of Algebra (1070).  Consequently, the triangle is referred to as the Khayyam triangle in Iran.

China

Yang Hui's TriangleIt is believed that the Chinese mathematician Jia Xian (1010–1070) invented Pascal's Triangle independently and he certainly used it as a tool for extracting square and cube roots.

About 200 years later, Yang Hui (1238–1298) discussed Jia Xian's method (for finding roots using the triangle) at length and explicitly acknowledged Jia Xian as the source.

It is still called Yang Hui's Triangle (and occasionally, Jai Xian's Triangle) in China today.  The illustration at right is from a publication by another Chinese mathematician, Zhu Shijie in his famous work, Jade Mirror of the Four Unknowns (1303).

Europe

The Jewish-French mathematician, astronomer and philosopher, Gersonides (Levi ben Gershon, 1288–1344) calculated the binomial coefficients using the multiplicative formula.  [As an aside, he was also the first person to experimentally falsify the Ptolemaic model of the universe (by observing the brightness of Mars, among other things) and appears to have been the first to argue that the stars were billions of times further away than others had calculated.]

In 1527, the German mathematician, astronomer and cartographer, Petrus Apianus (1495–1552) published a copy of the triangle on the frontispiece of his handbook of commercial arithmetic, Ein newe und wolgegründete underweisung aller Kauffmanns Rechnung in dreyen Büchern, mit schönen Regeln und fragstücken begriffen. Not long afterwards, in his Arithmetica integra (1544), Michael Stifel (1487-1567), a German monk, published a portion of the triangle (from the second to the middle column in each row), describing it as a table of figurate numbers.

Only twelve years later (1556), the Italian algebraist Niccolò Fontana Tartaglia (1500–1577) published six rows of the triangle in General Trattato di numeri, et misure.  In Italy, Pascal's triangle is referred to as Tartaglia's triangle.

In 1570, the Italian mathematician Gerolamo Cardano published the triangle and explained the additive and multiplicative rules for constructing it ...

... which brings us to Blaise Pascal and his work!

Around 1654, Blaise Pascal (1623-1662) was corresponding with his fellow French mathematician, Pierre de Fermat (1601-1665) concerning some matters relating to probability theory and its application to resolving some problems in gambling. Because of the triangle's usefulness in binomial theory and, therefore, in probability, he wrote a detailed analysis of it, Traité du triangle arithmétique (Treatise on the Arithmetic Triangle).  It was published posthumously, in 1665.  What made this work stand out from all preceding texts was that Pascal's was the first treatise in history that was completely devoted to analysing the triangle.

In 1708, Pierre Raymond de Montmort (1678-1719) called the triangle the "Table de M. Pascal pour les combinaisons" (Table of Mr Pascal for Combinations) and in 1730, Abraham de Moivre (1667-1754) referred to it as "Triangulum Arithmeticum Pascalianum" (Latin for "Pascal's Arithmetic Triangle").

Since those days it has been known as Pascal's Triangle in the West.

Pascal's Traité du triangle arithmétique

The Traité du triangle arithmétique was written by Blaise Pascal in 1654 around the time that he was corresponding with another French mathematician, Pierre de Fermat.  They were discussing problems in calculating the odds in games of chance and, basically, inventing the new mathematical discipline of probability.  He did not publish this seminal work, however.  It was found among his notes and published posthumously, in 1665.

To give you some historical context for this period let me share that, during 1665, the Great Plague was raging in England and, since Cambridge University had been closed because of the plague, Isaac Newton was living at his home in Woolsthorpe and developing his calculus, theories concerning optics, and laws of gravitation and motion.  It was also a year before the Great Fire of London (1666).

The Traité du triangle arithmétique is just 36 pages long.  It is divided into two parts. The first is the Treatise on the Arithmetical Triangle, consisting of a description of Pascal's Triangle and its structure.  The second part, Uses of the Arithmetical Triangle, contains further analysis of the Triangle and its applications to probability.

The second part has four sections:

  1. theory of figurate numbers
  2. theory of combinations
  3. how to divide the stakes in games of chance
  4. a study concerning the powers of binomial expressions.

If you would like to read an English translation of this work, you may thank Richard Pulskamp from the Department of Mathematics and Computer Science at Xavier University, Cincinnati, Ohio who made his translation available (on the Internet) in 2009.

ive been struggling at uni on an engineering degree with the math but your 4 videos on the various differentiation rules has cracked it for me. Cheers mate!
Matthew Marten (on a CCM YouTube video about Using a Combination of the Chain, Product and Quotient Rules)

See all Testimonials

Sign up to my Newsletter

Copyright © Crystal Clear Mathematics | All Rights Reserved

Website Design: www.webdesignnsw.com.au | Photography: Katieriversphotography.com.au