'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, ) ); Probability | 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; ?>

Probability

Tossed Coin About to Land in a Human HandWhat are the chances?

Chance is involved in so much of our lives and in so much of the physical world that it cannot be ignored.  Despite this, it was only in the mid 1600s that mathematicians really began to study chance … and the discipline of probability was born!

A French writer, and amateur mathematician, Antoine Gombaud became interested in a number of gambling problems.  One, in particular, was already centuries old.  If two players agreed to play a fixed number of games (a best of seven, for example), how should they divide the stake if the game is interrupted?  How would their existing wins (four games to one, for example) affect their prospects for ultimately winning the set of games and, therefore, how the stake should be divided?

He enlisted the help of Mersenne’s circle of educated friends and two mathematicians in particular took a particular interest in these problems.  Blaise Pascal and Pierre de Fermat corresponded with Gombaud and the two of them established the general  principles of probability theory.  Gerolamo Cardano was also involved in the discussions.

Within a couple of years, the famous Dutch scientist Christiaan Huygens (who taught Gottfried Leibniz analytical geometry and discussed Iceland Spar and other matters with Isaac Newton) had learned of this correspondence and published the first book containing a study of probability theory, De Ratiociniis in Ludo Aleae (1657).

Very quickly, probability became a popular field of study.

The Swiss mathematician, Jacob Bernoulli, wrote a seminal treatise on combinatorics and probability called Ars Conjectandi (The Art of Conjecturing).  Sadly (for him), it was published eight years after his death by his nephew, Nicolaus Bernoulli, in 1713.

The French mathematician, Abraham de Moivre, published the first complete probability text book, The Doctrine of Chances, in 1718.  Because he lived most of his life in England (as a Hugenot exile from France), this book was written in English and you may download and read a copy of it at the archive.org site.

In 1812 Pierre-Simon Laplace introduced a host of new ideas and mathematical techniques in his book, Théorie Analytique des Probabilités (you can read an English translation of the relevant section of this book thanks to the kind folk at Xavier University in Cincinnati, Ohio).  It was Laplace who first seriously applied principles of probability to scientific and practical matters.

Magnetic Dice Trick (aka Two 'Magic' Dice)

Many years ago I read a story (probably fictitious) about two boys who earned a modest income by selling pairs of dice to gamblers.

The story related that they would get the gamblers to roll two dice until they rolled 11 (a 5 and a 6) in order to 'magnetise' or 'align' the dice. Amazingly, once this had happened, the dice rolled in a particular way with very high probability!

In this video I explain and demonstrate the process ... and then analyse it. It is a wonderful exercise in probability and I hope you enjoy it. You will learn some good mathematics, and may even be a little more wary of young boys offering you something that looks too good to be true!

By way of explanation, I like to think and talk of three kinds of probability. There is a theoretical probability (the kind that we often calculate in school when analysing a particular situation). There is experimental probability, where our estimates are based on past experiences (this is the basis for our weather forecasts, for example). And I like to talk of 'perceived' or 'psychological' probability (which is the intuitive way that most people seem to think of a problem). The world is full of examples of people who wrongly estimate their real chances of winning something or succeeding at something. This is because there is a big difference between their personal 'perceived' chances and their actual (theoretical or experimental) chances. The Darwin Awards, for example, record the results of such miscalculations! The example I discuss in this video is effective because it is based on exactly this sort of disparity ... between our perceptions and reality.

Enjoy!

Wow, how useful. … I always had a hard time with the chain rule, until I watched this video. The right presentation makes all the difference. Thank you very much. … These 20 second math videos you’ve graciously posted are excellent. I’m my little corner of the world, you’ve done great things.
avaratatat (on a CCM YouTube video about the Chain Rule)

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