Current page nav highlight

//Current Page Highlighting
function extractPageName(hrefString)
{
var arr = hrefString.split('/');
return (arr.length<2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();
}

function setActiveMenu(arr, crtPage)
{
for (var i=0; i<arr.length; i++)
{
if(extractPageName(arr[i].href) == crtPage)
{
if (arr[i].parentNode.tagName != "DIV")
{
arr[i].className = "current";
arr[i].parentNode.className = "current";
}
}
}
}

function setCurrentPage(navId)
{
hrefString = document.location.href ? document.location.href : document.location;

if (document.getElementById(navId)!=null)
setActiveMenu(document.getElementById(navId).getElementsByTagName("a"), extractPageName(hrefString));
}

//End Current Page Highlighting

Create page with php

<?php

$page_check = get_page_by_title('My New Page');
$page_check_id = $page_check->ID;

$new_page = array(
'post_type' => 'page',
'post_title' => 'My New Page',
'post_content' => 'This is my new page',
'post_status' => 'publish',
'post_author' => 1,
);

if(!isset($page_check_id)){
wp_insert_post($new_page);
$new_page_data = get_page_by_title('My New Page');
$new_page_id = $new_page_data->ID;
update_post_meta($new_page_id, '_wp_page_template','template-video.php');
}

//This version works as an engine for creating many pages by running through one function.  The page title is used for the page template file name so: 'Audio Admin' will be tied to the template named template-audioadmin.php

$default_pages = array('Audio Admin','Video Admin');
foreach($default_pages as $page){
$page_check = get_page_by_title($page);
$page_check_id = $page_check->ID;
if(!isset($page_check_id)) lmcb_create_pg($page);
}
function lmcb_create_pg($title){
$new_page = array(
'post_type' => 'page',
'post_title' => $title,
'post_status' => 'publish',
'post_author' => 1,
);
wp_insert_post($new_page);
$new_page_data = get_page_by_title($title);
$new_page_id = $new_page_data->ID;
$lower_title = strtolower($title);
$template_file = 'template-' . str_replace(' ','',$lower_title) . '.php';
echo $template_file;
update_post_meta($new_page_id, '_wp_page_template',$template_file);
}

?>

Shortcode

//Shortcode [myshortcode id=##### width=### height=### auto=true]
function show_myshortcode($atts){
extract(shortcode_atts(array(
'id' => 'Not Set',
'width' => '200',
'height' => '200',
'auto' => 'false',
), $atts));

return "This is the Shortcode Content: {$id} {$width} {$height} {$auto}";
}

add_shortcode('myshortcode', 'show_myshortcode');

Add meta box to page or post

function mw_member_add_meta_box( $page, $context ) {
if ( ( 'page' === $page || 'post' === $page ) && 'advanced' === $context )
add_meta_box( 'mw-member-levels', 'Member Levels', 'mw_select_member_level', $page, 'advanced', 'low' );
}

Get Page ID

$this_page_id = get_query_var('page_id');

$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");

$post->ID