'Main Navigation Menu')); add_action('wp_head', 'theme_css'); add_action('wp_head', 'theme_js'); /*----------------------------------*/ /* Add CSS Styles to Header */ /*----------------------------------*/ function theme_css() { echo ''; } //If we don't have a content width specified, assume this as default if ( ! isset( $content_width ) ){ $content_width = 980; } /*----------------------------------*/ /* Custom Styling */ /*----------------------------------*/ function vpthemes_custom_styling() { $bkg_color = of_get_option('bkg_color'); $bkg_image = of_get_option('bkg_image'); $bkg_image_rpt = of_get_option('bkg_image_rpt'); $bkg_image_pos = of_get_option('bkg_image_pos'); $link_color = of_get_option('link_color'); $link_hover_color = of_get_option('link_hover_color'); $mosaic_overlay = of_get_option('mosaic_overlay_color'); $mosaic_text = of_get_option('hover_text_color'); $action_btn_text = of_get_option('button_text_color'); $action_text = of_get_option('action_text_color'); $action_text_hover = of_get_option('button_text_hover_color'); $action_btn = of_get_option('button_color'); $action_btn_hover = of_get_option('button_hover_color'); $sidebar_position = of_get_option('sidebar_position'); $preset_bkg = of_get_option('preset_bkg'); $body_font = of_get_option( 'body_font'); $output = ''; // Add CSS to output if ( $body_font ) $output .= 'body {font-family:' . $body_font['face'] . '}' . "\n"; $output .= 'body {font-size:' . $body_font['size'] . '}' . "\n"; $output .= 'body {color:' . $body_font['color'] . '}' . "\n"; $output .= '.recentcomments a {clear:both !important;padding-right: 5px !important;padding-left: 15px !important;}' . "\n"; if ( $body_font['style']<>"bold" && $body_font['style']<>"bold italic") $output .= 'body {font-style:' . $body_font['style'] . '}' . "\n"; if ( $body_font['style']<>"Normal" && $body_font['style']<>"italic" && $body_font['style']<>"bold italic") $output .= 'body {font-weight:' . $body_font['style'] . '}' . "\n"; if ( $body_font['style']=="bold italic") $output .= 'body {font-weight:bold;font-style:italic}' . "\n"; if ($sidebar_position == 1) { $output .= '#sidebar {float: right; padding-left: 0px; padding-right: 25px; }' . "\n"; $output .= '#main-area {float: right;}' . "\n";} if ($sidebar_position == 0) { $output .= '#sidebar {float: left; padding-left: 25px; padding-right: 0px; }' . "\n"; $output .= '#main-area {float: left;}' . "\n";} if ( $action_text_hover ) $output .= '.action-button:hover {color:' . $action_text_hover . '}' . "\n"; if ( $action_btn_hover ) $output .= '.action-button:hover {background-color:' . $action_btn_hover . '}' . "\n"; if ( $action_btn ) $output .= '.action-button {background-color:' . $action_btn . '}' . "\n"; if ( $action_text ) $output .= '.call-to-action-text {color:' . $action_text . '!important}' . "\n"; if ( $action_btn_text ) $output .= '.action-button {color:' . $action_btn_text . '}' . "\n"; if ( $mosaic_text ) $output .= '.details p,.details h4 {color:' . $mosaic_text . '!important}' . "\n"; if ( $mosaic_overlay ) $output .= '.mosaic-overlay object.details {background-color:' . $mosaic_overlay . '!important}' . "\n"; if ( $bkg_color ) $output .= 'body {background:' . $bkg_color . '}' . "\n"; if ( $preset_bkg == '2') { $bkg_image = get_bloginfo('stylesheet_directory') . '/images/pattern-1.png';} if ( $preset_bkg == '3') { $bkg_image = get_bloginfo('stylesheet_directory') . '/images/pattern-2.png';} if ( $preset_bkg == '4') { $bkg_image = get_bloginfo('stylesheet_directory') . '/images/pattern-3.png';} if ( $preset_bkg == '5') { $bkg_image = get_bloginfo('stylesheet_directory') . '/images/pattern-4.png';} if ( $preset_bkg == '6') { $bkg_image = get_bloginfo('stylesheet_directory') . '/images/pattern-5.png';} if ( $preset_bkg == '7') { $bkg_image = get_bloginfo('stylesheet_directory') . '/images/pattern-6.png';} if ( $preset_bkg == '8') { $bkg_image = get_bloginfo('stylesheet_directory') . '/images/pattern-7.png';} if ($bkg_image_rpt == '0') { $bkg_image_rpt = "no-repeat";} if ($bkg_image_rpt == '1') { $bkg_image_rpt = "repeat-x";} if ($bkg_image_rpt == '2') { $bkg_image_rpt = "repeat-y";} if ($bkg_image_rpt == '3') { $bkg_image_rpt = "repeat";} if ($bkg_image_pos == '0') { $bkg_image_pos = "top left";} if ($bkg_image_pos == '1') { $bkg_image_pos = "top center";} if ($bkg_image_pos == '2') { $bkg_image_pos = "top right";} if ($bkg_image_pos == '3') { $bkg_image_pos = "center left";} if ($bkg_image_pos == '4') { $bkg_image_pos = "center center";} if ($bkg_image_pos == '5') { $bkg_image_pos = "center right";} if ($bkg_image_pos == '6') { $bkg_image_pos = "bottom left";} if ($bkg_image_pos == '7') { $bkg_image_pos = "bottom center";} if ($bkg_image_pos == '8') { $bkg_image_pos = "bottom right";} if ( $bkg_image ) $output .= 'body {background:url( ' . $bkg_image . ')'.$bkg_image_rpt .' '. $bkg_image_pos. ' '.$bkg_color.'}' . "\n"; if ( $link_color ) $output .= 'h1, h2, h3, h4, h5, h6, .service-content h3.boxtitle,h2.posts-title,.breadcrumbs,.widget-title,#footer-wrap h2.widget-title,.post-title,#section-title,#nav ul li a, #nav ul li a:visited, a {color:' . $link_color . '}' . "\n"; if ( $link_hover_color ) $output .= '#nav ul li a:hover, #nav .menu ul li.current_page_item a, #nav ul li.current-menu-item a, a:hover {color:' . $link_hover_color . '}' . "\n"; $output .= '#nav ul.sub-menu li a:hover, #nav ul.children li a:hover {background:' . $link_hover_color . '}' . "\n"; // Output styles if ( isset( $output ) && $output != '' ) { $output = strip_tags( $output ); $output = "\n\n"; echo $output; } } /*----------------------------------*/ /* Add Java Scripts to Header */ /*----------------------------------*/ function theme_js() { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } /*--------------------------------------*/ /* Function to Change Excerpt Length */ /*--------------------------------------*/ function custom_excerpt_length( $length ) { return 30; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); /*----------------------------------*/ /* Pagination */ /*----------------------------------*/ function pagination($pages = '', $range = 4) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "
Page ".$paged." of ".$pages.""; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "« First"; if($paged > 1 && $showitems < $pages) echo "‹ Previous"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "".$i."":"".$i.""; } } if ($paged < $pages && $showitems < $pages) echo "Next ›"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "Last »"; echo "
\n"; } } /*----------------------------------*/ /* Main Sidebar */ /*----------------------------------*/ register_sidebar( array( 'name' => __( 'Main Sidebar', 'vpthemes' ), 'id' => 'global-main-sidebar', 'description' => __( 'The global main sidebar, leave empty if unwanted.', 'vpthemes' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); /*----------------------------------*/ /* Footer column A */ /*----------------------------------*/ register_sidebar( array( 'name' => __( 'Footer column A', 'vpthemes' ), 'id' => 'footer-column-a', 'description' => __( 'The left column in the footer.', 'vpthemes' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); /*----------------------------------*/ /* Footer column B */ /*----------------------------------*/ register_sidebar( array( 'name' => __( 'Footer column B', 'vpthemes' ), 'id' => 'footer-column-b', 'description' => __( 'First middle column in the footer.', 'vpthemes' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); /*----------------------------------*/ /* Footer column C */ /*----------------------------------*/ register_sidebar( array( 'name' => __( 'Footer column C', 'vpthemes' ), 'id' => 'footer-column-c', 'description' => __( 'Second middel column in the footer.', 'vpthemes' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); /*----------------------------------*/ /* Add Comments Support */ /*----------------------------------*/ if ( ! function_exists( 'vpthemes_comment' ) ) : function vpthemes_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • ', '' ); ?>

  • id="li-comment-">
    ' ); ?>
    on
    %s says:'), get_comment_author_link()) ?> ', '' ); ?>
    comment_approved == '0' ) : ?>
    __( 'Reply ', 'vpthemes' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    get_results($q); foreach ($q as $cat) { $categories[$cat->term_id] = $cat->name; } // foreach return($categories); } /*--------------------------------------*/ /* Get URL of first image in the post */ /*--------------------------------------*/ function vpthemes_get_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post->post_content, $matches); $first_img = $matches [1] [0]; // If no image found - display default image instead if(empty($first_img)){ $first_img = get_bloginfo('template_directory')."/images/noimage.jpg"; } return $first_img; } /*--------------------------------------*/ /* Get URL of first video in the post */ /*--------------------------------------*/ function vpthemes_get_video() { global $post, $posts; $iframe_url = ''; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post->post_content, $matches); $iframe_url = $matches [1] [0]; return $iframe_url; } /*--------------------------------------*/ /* Gallery */ /*--------------------------------------*/ function vpthemes_gallery($orderby='menu_order',$order='ASC') { global $post; $gallery=get_posts('post_type=attachment&post_mime_type=image&numberposts=-1&post_parent='. $post->ID.'&orderby='.$orderby.'&order='.$order); return $gallery; } /*--------------------------------------*/ /* Gets page id by its name */ /*--------------------------------------*/ if ( ! function_exists( 'get_pageId' ) ){ function get_pageId( $page_name ) { $page_name = html_entity_decode( $page_name, ENT_QUOTES ); $page = get_page_by_title( $page_name ); return $page->ID; } } ?>