term_id; } /////////////////////// //CONTENT WIDTH STUFF /////////////////////// if ( ! isset( $content_width ) ) $content_width = 960; /////////////////////// //EXCERPT STUFF /////////////////////// function new_excerpt_length($length) { return 25; } add_filter('excerpt_length', 'new_excerpt_length'); function new_excerpt_more($more) { global $post; return ' ...'; } add_filter('excerpt_more', 'new_excerpt_more'); /////////////////////// //ADD MENU SUPPORT /////////////////////// add_theme_support( 'menus' ); register_nav_menu('main', 'Main Navigation Menu'); /////////////////////// //BREADCRUMBS /////////////////////// function dimox_breadcrumbs() { $delimiter = '  /  '; $name = __('Home','themolitor'); $currentBefore = ''; $currentAfter = ' '; if ( !is_home() && !is_front_page() || is_paged() ) { echo '
'; global $post; $home = home_url(); echo '' . $name . ' ' . $delimiter . ' '; if ( is_category() ) { global $wp_query; $cat_obj = $wp_query->get_queried_object(); $thisCat = $cat_obj->term_id; $thisCat = get_category($thisCat); $parentCat = get_category($thisCat->parent); if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' ')); echo $currentBefore . ''; single_cat_title(); echo '' . $currentAfter; } elseif ( is_day() ) { echo '' . get_the_time('Y') . ' ' . $delimiter . ' '; echo '' . get_the_time('F') . ' ' . $delimiter . ' '; echo $currentBefore . get_the_time('d') . $currentAfter; } elseif ( is_month() ) { echo '' . get_the_time('Y') . ' ' . $delimiter . ' '; echo $currentBefore . get_the_time('F') . $currentAfter; } elseif ( is_year() ) { echo $currentBefore . get_the_time('Y') . $currentAfter; } elseif ( is_single() && !is_attachment() ) { $cat = get_the_category(); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); echo $currentBefore; _e("Current Page",'themolitor'); echo $currentAfter; } elseif ( is_attachment() ) { $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); echo '' . $parent->post_title . ' ' . $delimiter . ' '; echo $currentBefore; the_title(); echo $currentAfter; } elseif ( is_page() && !$post->post_parent ) { echo $currentBefore; the_title(); echo $currentAfter; } elseif ( is_page() && $post->post_parent ) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '' . get_the_title($page->ID) . ''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' '; echo $currentBefore; the_title(); echo $currentAfter; } elseif ( is_search() ) { echo $currentBefore . __('Search Results','themolitor') . $currentAfter; } elseif ( is_tag() ) { echo $currentBefore . __('Posts tagged '','themolitor'); single_tag_title(); echo ''' . $currentAfter; } elseif ( is_author() ) { global $author; $userdata = get_userdata($author); echo $currentBefore . __('Articles posted by ','themolitor') . $userdata->display_name . $currentAfter; } elseif ( is_404() ) { echo $currentBefore . __('Error 404','themolitor') . $currentAfter; } if ( get_query_var('paged') ) { if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' ('; echo __('Page','themolitor') . ' ' . get_query_var('paged'); if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')'; } echo '
'; } } /////////////////////// //SIDEBAR GENERATOR (FOR SIDEBAR AND FOOTER) /////////////////////// if ( function_exists('register_sidebar') ) register_sidebar(array('name'=>'Live Widgets', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); /////////////////////// //CUSOTM POST OPTIONS /////////////////////// $key = "key"; $meta_boxes = array( "category" => array( "name" => "category", "title" => "Category for page template - pages only", "description" => "If using a page template, enter the category name you would like to use. For example, 'My Category Name'. This only applies to pages (not posts)."), "video" => array( "name" => "video", "title" => "Media Embed Code (YouTube, Vimeo, or Google Maps) - posts only", "description" => "NOTE: Width must be 280. For fixed grid layout, ideal dimensions are 280x170") ); function create_meta_box() { global $key; if( function_exists( 'add_meta_box' ) ) { add_meta_box( 'new-meta-boxes', ' Custom Post Options', 'display_meta_box', 'post', 'normal', 'high' ); add_meta_box( 'new-meta-boxes', ' Custom Post Options', 'display_meta_box', 'page', 'normal', 'high' ); } } function display_meta_box() { global $post, $meta_boxes, $key; ?>
    ID, $key, true); ?>

    cat_ID] = $category->cat_name; } //------------------------------- //GENERAL SECTION //------------------------------- //ADD GENERAL SECTION $wp_customize->add_section( 'themolitor_customizer_general_section', array( 'title' => __( 'General', 'themolitor' ), 'priority' => 1 )); //LOGO $wp_customize->add_setting( 'themolitor_customizer_logo'); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themolitor_customizer_logo', array( 'label' => __('Logo', 'themolitor'), 'section' => 'themolitor_customizer_general_section', 'settings' => 'themolitor_customizer_logo', 'priority' => 1 ))); //THEME SKIN $wp_customize->add_setting('themolitor_customizer_theme_skin', array( 'capability' => 'edit_theme_options', 'default' => 'light' )); $wp_customize->add_control( 'themolitor_customizer_theme_skin', array( 'label' => __('Theme Skin','themolitor'), 'section' => 'themolitor_customizer_general_section', 'type' => 'select', 'choices' => array('light' => 'Light','dark' => 'Dark'), 'settings' => 'themolitor_customizer_theme_skin', 'priority' => 2 )); //DISPLAY BREADCRUMBS $wp_customize->add_setting( 'themolitor_customizer_bread_onoff', array( 'default' => 1 )); $wp_customize->add_control( 'themolitor_customizer_bread_onoff', array( 'label' => 'Display Category Breadcrumbs', 'type' => 'checkbox', 'section' => 'themolitor_customizer_general_section', 'settings' => 'themolitor_customizer_bread_onoff', 'priority' => 3 )); //------------------------------- //COLORS SECTION //------------------------------- //ACCENT COLOR $wp_customize->add_setting( 'themolitor_customizer_accent_color', array( 'default' => '#748494' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'themolitor_customizer_accent_color', array( 'label' => __( 'Accent Color', 'themolitor'), 'section' => 'colors', 'settings' => 'themolitor_customizer_accent_color' ))); //------------------------------- //HOME SETTINGS SECTION //------------------------------- //ADD HOME SETTINGS SECTION $wp_customize->add_section( 'themolitor_customizer_home_section', array( 'title' => __( 'Home Settings', 'themolitor' ), 'priority' => 197 )); //HOME CATEGORY $wp_customize->add_setting('themolitor_home_category', array( 'capability' => 'edit_theme_options', 'type' => 'option' )); $wp_customize->add_control( 'themolitor_home_category', array( 'settings' => 'themolitor_home_category', 'label' => __('Home Category','themolitor'), 'section' => 'themolitor_customizer_home_section', 'type' => 'select', 'choices' => $options_categories, 'priority' => 1 )); //NUMBER OF ITEMS $wp_customize->add_setting( 'themolitor_customizer_home_number',array( 'default' => '8' )); $wp_customize->add_control('themolitor_customizer_home_number', array( 'label' => __( 'Number of items to display initially', 'themolitor'), 'section' => 'themolitor_customizer_home_section', 'settings' => 'themolitor_customizer_home_number', 'type' => 'text', 'priority' => 2 )); //------------------------------- //PORTFOLIO SETTINGS SECTION //------------------------------- //ADD FOOTER SECTION $wp_customize->add_section( 'themolitor_customizer_portfolio_section', array( 'title' => __( 'Portfolio Settings', 'themolitor' ), 'priority' => 198 )); //DISPLAY POST TITLE $wp_customize->add_setting( 'themolitor_customizer_post_title_onoff', array( 'default' => 1 )); $wp_customize->add_control( 'themolitor_customizer_post_title_onoff', array( 'label' => 'Display Post Title', 'type' => 'checkbox', 'section' => 'themolitor_customizer_portfolio_section', 'settings' => 'themolitor_customizer_post_title_onoff', 'priority' => 1 )); //DISPLAY EXCERPT $wp_customize->add_setting( 'themolitor_customizer_excerpt_onoff', array( 'default' => 1 )); $wp_customize->add_control( 'themolitor_customizer_excerpt_onoff', array( 'label' => 'Display Post Excerpt', 'type' => 'checkbox', 'section' => 'themolitor_customizer_portfolio_section', 'settings' => 'themolitor_customizer_excerpt_onoff', 'priority' => 2 )); //PREVIEW IMAGE LINK $wp_customize->add_setting('themolitor_customizer_preview', array( 'capability' => 'edit_theme_options', 'default' => 'post' )); $wp_customize->add_control( 'themolitor_customizer_preview', array( 'label' => __('Preview Image Links to...','themolitor'), 'section' => 'themolitor_customizer_portfolio_section', 'type' => 'select', 'choices' => array('post' => 'Post','image' => 'Image'), 'settings' => 'themolitor_customizer_preview' )); //------------------------------- //FOOTER SECTION //------------------------------- //ADD FOOTER SECTION $wp_customize->add_section( 'themolitor_customizer_footer_section', array( 'title' => __( 'Footer', 'themolitor' ), 'priority' => 199 )); //FOOTER TEXT $wp_customize->add_setting( 'themolitor_customizer_footer'); $wp_customize->add_control('themolitor_customizer_footer', array( 'label' => __( 'Footer Text', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_footer', 'type' => 'text', 'priority' => 1 )); //DISPLAY RSS BUTTON $wp_customize->add_setting( 'themolitor_customizer_rss_onoff', array( 'default' => 1 )); $wp_customize->add_control( 'themolitor_customizer_rss_onoff', array( 'label' => 'Display RSS Button', 'type' => 'checkbox', 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_rss_onoff', 'priority' => 5 )); //TWITTER $wp_customize->add_setting( 'themolitor_customizer_twitter'); $wp_customize->add_control('themolitor_customizer_twitter', array( 'label' => __( 'Twitter URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_twitter', 'type' => 'text', 'priority' => 6 )); //FACEBOOK $wp_customize->add_setting( 'themolitor_customizer_facebook'); $wp_customize->add_control('themolitor_customizer_facebook', array( 'label' => __( 'Facebook URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_facebook', 'type' => 'text', 'priority' => 7 )); //FLIKr $wp_customize->add_setting( 'themolitor_customizer_flikr'); $wp_customize->add_control('themolitor_customizer_flikr', array( 'label' => __( 'Flikr URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_flikr', 'type' => 'text', 'priority' => 8 )); //MYSPACE $wp_customize->add_setting( 'themolitor_customizer_myspace'); $wp_customize->add_control('themolitor_customizer_myspace', array( 'label' => __( 'MySpace URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_myspace', 'type' => 'text', 'priority' => 9 )); //LINKEDIN $wp_customize->add_setting( 'themolitor_customizer_linkedin'); $wp_customize->add_control('themolitor_customizer_linkedin', array( 'label' => __( 'LinkedIn URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_linkedin', 'type' => 'text', 'priority' => 10 )); //YOUTUBE $wp_customize->add_setting( 'themolitor_customizer_youtube'); $wp_customize->add_control('themolitor_customizer_youtube', array( 'label' => __( 'YouTube URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_youtube', 'type' => 'text', 'priority' => 11 )); //SKYPE $wp_customize->add_setting( 'themolitor_customizer_skype'); $wp_customize->add_control('themolitor_customizer_skype', array( 'label' => __( 'Skype URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_skype', 'type' => 'text', 'priority' => 12 )); //VIMEO $wp_customize->add_setting( 'themolitor_customizer_vimeo'); $wp_customize->add_control('themolitor_customizer_vimeo', array( 'label' => __( 'Vimeo URL', 'themolitor'), 'section' => 'themolitor_customizer_footer_section', 'settings' => 'themolitor_customizer_vimeo', 'type' => 'text', 'priority' => 13 )); //------------------------------- //GOOGLE FONT SECTION //------------------------------- //ADD GOOGLE FONT SECTION $wp_customize->add_section( 'themolitor_customizer_googlefont_section', array( 'title' => __( 'Google Custom Font', 'themolitor' ), 'priority' => 200 )); //GOOGLE API $wp_customize->add_setting( 'themolitor_customizer_google_api', array( 'default' => '' )); $wp_customize->add_control('themolitor_customizer_google_api', array( 'label' => __( 'Google Font API Link', 'themolitor'), 'section' => 'themolitor_customizer_googlefont_section', 'settings' => 'themolitor_customizer_google_api', 'type' => 'text', 'priority' => 1 )); //GOOGLE KEYWORD $wp_customize->add_setting( 'themolitor_customizer_google_key', array( 'default' => 'Droid Sans' )); $wp_customize->add_control('themolitor_customizer_google_key', array( 'label' => __( 'Google Font Keyword', 'themolitor'), 'section' => 'themolitor_customizer_googlefont_section', 'settings' => 'themolitor_customizer_google_key', 'type' => 'text', 'priority' => 2 )); //------------------------------- //CUSTOM CSS SECTION //------------------------------- //ADD CSS SECTION $wp_customize->add_section( 'themolitor_customizer_custom_css', array( 'title' => __( 'CSS', 'themolitor' ), 'priority' => 201 )); //CUSTOM CSS $wp_customize->add_setting( 'themolitor_customizer_css'); $wp_customize->add_control( new Example_Customize_Textarea_Control( $wp_customize, 'themolitor_customizer_css', array( 'label' => __( 'Custom CSS', 'themolitor'), 'section' => 'themolitor_customizer_custom_css', 'settings' => 'themolitor_customizer_css' ))); } ?>