'Social Area',
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => 'Footer Logo',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => 'Bottom Line',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => 'Top Line',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => 'Footer Area',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
}
function virtuelabs_menu() {
register_nav_menus(
array(
'main_menu' => 'Main Navigation',
'secondary_menu' => 'Footer Navigation'
)
);
}
add_action( 'init', 'virtuelabs_menu' );
/*=======================================
Add Thumbnail Support
=======================================*/
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 150 ); // default Post Thumbnail dimensions
}
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'blog-thumb', 878, 999999); //300 pixels wide (and unlimited height)
add_image_size( 'homepage-thumb', 220, 180, true ); //(cropped)
}
add_filter('the_content', 'my_addlightboxrel');
function my_addlightboxrel($content) {
global $post;
$pattern ="//i";
$replacement = '';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
/*=======================================
Add WP Breadcrumbs
=======================================*/
function kama_breadcrumbs( $sep='/
', $term=false, $taxonomies=false ){
global $post, $wp_query, $wp_post_types;
$l = (object) array(
'home' => __('Home','omnea')
,'paged' => __('Page %s','omnea')
,'p404' => __('Error 404','omnea')
,'search' => __('Search Result','omnea')
,'author' => __('Author Archive: %s','omnea')
,'year' => __('Archive for %s year','omnea')
,'month' => __('Archive for: %s','omnea')
,'attachment' => __('Attachments: %s','omnea')
,'tag' => __('Filter by: %s','omnea')
,'tax_tag' => __('The Blog','omnea')
,'woo' => __('Shop', 'omnea')
);
if( $paged = $wp_query->query_vars['paged'] ){
$pg_patt = '';
$pg_end = ''. $sep . sprintf($l->paged, $paged);
}
if( is_front_page() )
return print ($paged?sprintf($pg_patt, home_url()):'') . $l->home . $pg_end;
if( is_404() )
$out = $l->p404;
elseif( is_search() ){
$s = preg_replace('@', $GLOBALS['s']);
$out = sprintf($l->search, $s);
}
elseif( is_author() ){
$q_obj = &$wp_query->queried_object;
$out = ($paged?sprintf( $pg_patt, get_author_posts_url($q_obj->ID, $q_obj->user_nicename) ):'') . sprintf($l->author, $q_obj->display_name) . $pg_end;
}
elseif( is_year() || is_month() || is_day() ){
$y_url = get_year_link( $year=get_the_time('Y') );
$m_url = get_month_link( $year, get_the_time('m') );
$y_link = ''. $year .'';
$m_link = ''. get_the_time('F') .'';
if( is_year() )
$out = ($paged?sprintf($pg_patt, $y_url):'') . sprintf($l->year, $year) . $pg_end;
elseif( is_month() )
$out = $y_link . $sep . ($paged?sprintf($pg_patt, $m_url):'') . sprintf($l->month, get_the_time('F')) . $pg_end;
elseif( is_day() )
$out = $y_link . $sep . $m_link . $sep . get_the_time('l');
}
elseif( $wp_post_types[$post->post_type]->hierarchical ){
$parent = $post->post_parent;
$crumbs=array();
while($parent){
$page = &get_post($parent);
$crumbs[] = ''. $page->post_title .''; //$page->guid
$parent = $page->post_parent;
}
$crumbs = array_reverse($crumbs);
foreach ($crumbs as $crumb)
$out .= $crumb.$sep;
$out = $out.$post->post_title;
}
else
{
if(!$term){
if( is_single() ){
if( !$taxonomies ){
$taxonomies = get_taxonomies( array('hierarchical'=>true, 'public'=>true) );
if( count($taxonomies)==1 ) $taxonomies = 'category';
}
if( $term = get_the_terms( $post->post_parent?$post->post_parent:$post->ID, $taxonomies ) )
$term = array_shift($term);
}
else
$term = $wp_query->get_queried_object();
}
if( !$term && !is_attachment() )
return print "Error: Taxonomy isn`t defined!";
if( is_attachment() ){
if(!$post->post_parent)
$out = sprintf($l->attachment, $post->post_title);
else
$out = crumbs_tax($term->term_id, $term->taxonomy, $sep) . "". get_the_title($post->post_parent) ."{$sep}{$post->post_title}"; //$ppost->guid
}
elseif( is_single() )
$out = crumbs_tax($term->parent, $term->taxonomy, $sep) . "{$term->name}{$sep}{$post->post_title}";
elseif( is_woocommerce() ){
$out = sprintf($l->woo);
}
elseif( !is_taxonomy_hierarchical($term->taxonomy) ){
if( is_tag() )
$out = $pg_term_start . sprintf($l->tag, $term->name) . $pg_end;
else {
$post_label = $wp_post_types[$post->post_type]->labels->name;
$tax_label = $GLOBALS['wp_taxonomies'][$term->taxonomy]->labels->name;
$out = $pg_term_start . sprintf($l->tax_tag, $post_label, $tax_label, $term->name) . $pg_end;
}
}
else
$out = crumbs_tax($term->parent, $term->taxonomy, $sep) . $pg_term_start . $term->name . $pg_end;
}
$home = ''. $l->home .'' . $sep;
return print $home . $out;
}
// Breadcrumbs
function crumbs_tax($term_id, $tax, $sep){
$termlink = array();
while( (int)$term_id ){
$term2 = get_term( $term_id, $tax );
$termlink[] = ''. $term2->name .' '. $sep;
$term_id = (int)$term2->parent;
}
$termlinks = array_reverse($termlink);
return implode('', $termlinks);
}
// Pagination
function wp_corenavi() {
global $wp_query, $wp_rewrite;
$pages = '';
$max = $wp_query->max_num_pages;
if (!$current = get_query_var('paged')) $current = 1;
$a['base'] = ($wp_rewrite->using_permalinks()) ? user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' ) : @add_query_arg('paged','%#%');
if( !empty($wp_query->query_vars['s']) ) $a['add_args'] = array( 's' => get_query_var( 's' ) );
$a['total'] = $max;
$a['current'] = $current;
$total = 1;
$a['mid_size'] = '3';
$a['end_size'] = '1';
$a['prev_text'] = 'Back';
$a['next_text'] = 'Next';
$a['total'] = $wp_query->max_num_pages;
echo paginate_links($a);
}
function my_search_form( $form ) {
$form = '';
return $form;
}
add_filter( 'get_search_form', 'my_search_form' );
add_theme_support(
'custom-background',
array(
// Let WordPress know what our default background color is.
// This is dependent on our current color scheme.
'default-color' => $default_background_color,
'default-image' => get_template_directory_uri() . '/images/background.jpg'
)
);
add_theme_support( 'post-formats', array( 'image','quote','video' ) );
if ( ! isset( $content_width ) ) $content_width = 1170;
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'custom-header');
?>