__( 'Navigation Menu', 'cloudfw' ) ) );
if ( ! isset( $content_width ) )
$content_width = 640;
}
}
/*
* Load All Environment Units of The Theme
*
* Hooks: wp_print_styles, wp_print_scripts, wp_head
* @since 1.0
**/
// Load Css Files
function cloudfw_load_css(){
wp_enqueue_style ('style', TMP_URL.'/style.css');
wp_enqueue_style ('shortcodes', TMP_URL.'/style.shortcodes.css');
wp_enqueue_style ('nivo-slider', TMP_URL.'/lib/css/nivo-slider.css');
wp_enqueue_style ('prettyphoto', TMP_URL.'/lib/css/prettyphoto.css');
}
// Load Javascript Files
function cloudfw_load_javascripts(){
wp_deregister_script('jquery');
wp_register_script ('jquery', TMP_URL.'/lib/js/jquery.js', NULL, '1.6.2');
wp_enqueue_script ('jquery');
if (is_singular())
wp_enqueue_script ('comment-reply');
wp_enqueue_script ('webfont', TMP_URL.'/lib/js/webfont.js', array( 'jquery' ));
wp_enqueue_script ('pack', TMP_URL.'/lib/js/pack.js', array( 'jquery' ));
wp_enqueue_script ('superfish', TMP_URL.'/lib/js/superfish.js', array( 'jquery' ));
wp_enqueue_script ('slides', TMP_URL.'/lib/js/slides.min.js', array( 'jquery' ));
wp_enqueue_script ('tipsy', TMP_URL.'/lib/js/tipsy.js', array( 'jquery' ));
wp_enqueue_script ('twitter', TMP_URL.'/lib/js/twitter.js', array( 'jquery' ));
wp_enqueue_script ('custom', TMP_URL.'/lib/js/custom.js', array( 'jquery' ));
wp_enqueue_script ('prettyphoto', TMP_URL.'/lib/js/prettyphoto.js', array( 'jquery' ));
wp_enqueue_script ('execute', TMP_URL.'/lib/js/execute.js', array( 'jquery' ));
if ($gmap_api_key = get_cOption('apis', 'gmap_api_key'))
wp_enqueue_script ('gmapapi', 'http://maps.google.com/maps?file=api&v=2&sensor=false&key='.$gmap_api_key, array( 'jquery' ), NULL);
}
// Add Internet Explorer Patches
function cloudfw_load_ie_necessaries(){
$theme_uri = TMP_URL;
echo "
";
}
// Add Javascript Options
function cloudfw_js_options(){
$ajax_url = cloudfw_ajax_url();
?>
theme_location) {
if ( is_front_page() )
$class .= ' current-menu-item';
$homeMenuItem = '
' .
$args->before .
'
' .
$args->after .
'';
$menuItems = $homeMenuItem . $menuItems;
}
return $menuItems;
}
/*
* Register Theme Widgets
*
* by cloud_widgets_init() on widgets_init hook
* @since 1.0
**/
add_action( 'widgets_init', 'cloud_widgets_init' );
function cloud_widgets_init() {
global $_opt, $widget_bars;
register_sidebar( array(
'name' => 'Default Page Sidebar',
'id' => 'primary-widget-area',
'description' => 'Default Page Sidebar',
'before_widget' => '',
'before_title' => '',
) );
$loop = $_opt[PFIX.'_footer']['widget_number'];
for ($footer_widget_number = 1; $footer_widget_number <= $loop; $footer_widget_number++) {
register_sidebar( array(
'name' => 'Footer #'.$footer_widget_number,
'id' => 'footer-widget-area-'.$footer_widget_number,
'description' => 'Footer Widget Area #'.$footer_widget_number,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
}
register_sidebar( array(
'name' => 'Header Sidebar',
'id' => 'header-widget-area',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => 'Blog Sidebar',
'id' => 'blog-widget-area',
'description' => '',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => 'Search Page Sidebar',
'id' => 'searchpage-widget-area',
'description' => 'Search Page Sidebar',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => 'Archive Pages Sidebar',
'id' => 'archive-widget-area',
'description' => 'Archive Pages Sidebar',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => '404 Error Page Sidebar',
'id' => '404-widget-area',
'description' => '404 Error Page Sidebar',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
if ($_opt[PFIX."_custom_sidebars"]):
foreach ($_opt[PFIX."_custom_sidebars"] as $bar_id => $bar ){
register_sidebar( array(
'name' => $bar["name"],
'id' => $bar_id,
'description' => $bar["desc"],
'before_widget' => '',
'before_title' => '',
) );
}
endif;
}
/*
* Navigation Menu Callback Function
*
* @since 1.0
**/
function cloudfw_wp_page_menu_none() {
echo '
';
}
/*
* Exclude Selected & System Pages From Pages List
*
* @since 1.0
**/
add_filter('wp_list_pages_excludes', 'cloudfw_excluding_page'); // function cloudfw_excluding_page() -> @cloudfw/inc/fn.php
/*
* Remove WordPress Version Information From Header for Security
*
* @since 1.0
**/
remove_action('wp_head', 'wp_generator');
/*
* CloudFw Custom Navigation Menu Walker
*
* @since 1.0
**/
class _walker extends Walker_Nav_Menu
{
function start_el(&$output, $item, $depth, $args)
{
global $wp_query, $_opt;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'depth-'.$depth;
if ($depth == 0)
$classes[] = 'navigation-height';
$megaMenu = get_post_meta( $item->ID, PFIX.'_mega_menu_active', true);
if (_isOnoff($megaMenu)) {
$classes[] = 'megaMenu';
$columns = get_post_meta( $item->ID, PFIX.'_mega_menu_columns', true);
if (!empty($columns))
$classes[] = "columns-{$columns}";
}else{
if($depth == 0)
$classes[] = 'NotmegaMenu';
}
if ($depth > 0) {
$hide_title = get_post_meta( $item->ID, PFIX.'_mega_menu_hide_title', true);
$item_image = get_post_meta( $item->ID, PFIX.'_mega_menu_image', true);
$item_image_kind = get_post_meta( $item->ID, PFIX.'_mega_menu_image_kind', true);
$item_image_width = get_post_meta( $item->ID, PFIX.'_mega_menu_image_width', true);
if (!empty($item_image) && $item_image_kind == 'icon') $classes[] = 'menu-icon';
if (_isOnoff($hide_title))
$classes[] = 'menu-hidden-title';
}
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = ' class="'. esc_attr( $class_names ) . '"';
$output .= $indent . '