';
}
$slider_ .= '';
$slider_ .= '
';
} else if ($theme_options['select_slider'] == "2") {
if ($slider_layout == 1) {
$slider_ .= '';
$slider_ .= '
- ';
foreach ($theme_options['slides'] as $key=>$slide) {
$val = wp_get_attachment_image_src( esc_attr($slide['attach_id']), 'main-slider');
$path_to_img = esc_url_raw($val[0]);
$slider_ .= '
- ';
if (!empty($slide['link'])) {
if (!empty($slide['is_blank'])) {
$slider_ .= '';
} else {
$slider_ .= '';
}
$slider_ .= '
'; $slider_ .= ''; } else { $slider_ .= '
'; } $slider_ .= '
';
}
$slider_ .= '
';
} else {
$slider_ .= '';
}
echo '
';
if (!empty($url_retina_logo_id)) echo '
';
if (!empty($url_logo_id) && empty($url_retina_logo_id)) echo '
';
if (empty($url_logo_id) && !empty($url_retina_logo_id)) echo '
';
} else {
echo '';
$out_footer_text .= $footer_text;
$out_footer_text .= ' ';
}
echo $out_footer_text;
}
}
}
/*Get position for social icons*/
if (!function_exists('fruitful_is_social_header')) {
function fruitful_is_social_header () {
$pos = false;
$theme_options = fruitful_get_theme_options();
if(!empty($theme_options['sl_position'])) { $pos = esc_attr($theme_options['sl_position']); }
return $pos;
}
}
/*Get footer social icons*/
if (!function_exists('fruitful_get_socials_icon')) {
function fruitful_get_socials_icon () {
$out = '';
$theme_options = fruitful_get_theme_options();
if(!empty($theme_options['facebook_url'])) { $out .= ''; }
if(!empty($theme_options['twitter_url'])) { $out .= ''; }
if(!empty($theme_options['linkedin_url'])) { $out .= ''; }
if(!empty($theme_options['myspace_url'])) { $out .= ''; }
if(!empty($theme_options['googleplus_url'])) { $out .= ''; }
if(!empty($theme_options['dribbble_url'])) { $out .= ''; }
if(!empty($theme_options['skype_link'])) { $out .= ''; }
if(!empty($theme_options['flickr_link'])) { $out .= ''; }
if(!empty($theme_options['youtube_url'])) { $out .= ''; }
if(!empty($theme_options['vimeo_url'])) { $out .= ''; }
if(!empty($theme_options['rss_link'])) { $out .= ''; }
if(!empty($theme_options['vk_link'])) { $out .= ''; }
if(!empty($theme_options['instagram_url'])) { $out .= ''; }
if(!empty($theme_options['pinterest_url'])) { $out .= ''; }
if(!empty($theme_options['yelp_url'])) { $out .= ''; }
if(!empty($theme_options['email_link'])) { $out .= ''; }
if(!empty($theme_options['github_link'])) { $out .= ''; }
if(!empty($theme_options['tumblr_link'])) { $out .= ''; }
if(!empty($theme_options['soundcloud_link'])) { $out .= ''; }
if(!empty($theme_options['tripadvisor_link'])) { $out .= ''; }
echo '
', '
' ); $New = array( '','' ); $content = str_replace( $Old, $New, $content ); return $content; } } if ( ! function_exists( 'fruitful_get_class_pos' ) ) { function fruitful_get_class_pos($index) { if ($index == 0) { $pos_class = 'left-pos'; } else if ($index == 1) { $pos_class = 'center-pos'; } else { $pos_class = 'right-pos'; } return esc_attr($pos_class); } } if ( ! function_exists( 'fruitful_kses_data' ) ) { function fruitful_kses_data($text = null) { $allowed_tags = wp_kses_allowed_html( 'post' ); return wp_kses($text, $allowed_tags); } } if ( ! function_exists( 'fruitful_get_languages_list' ) ) { function fruitful_get_languages_list(){ $theme_options = fruitful_get_theme_options(); if( function_exists('icl_get_languages') && $theme_options['is_wpml_ready'] == 'on' ){ $languages = icl_get_languages('skip_missing=0'); if(!empty($languages)){ echo '';
}
}
}
}
if ( ! function_exists( 'fruitful_wp_corenavi' ) ) {
function fruitful_wp_corenavi() {
global $wp_query,
$wp_rewrite;
$next_label = $prev_label = '';
if (wp_is_mobile()) {
$next_label = __(' « ','fruitful');
$prev_label = __(' » ','fruitful');
} else {
$next_label = __('« Previous Page','fruitful');
$prev_label = __('Next Page »','fruitful');
}
$pages = '';
$max = $wp_query->max_num_pages;
if (!$current = get_query_var('paged')) {
$current = 1;
}
$a['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999));
$a['total'] = $max;
$a['current'] = $current;
$total = 0; //1 - display the text "Page N of N", 0 - not display
$a['mid_size'] = 2; //how many links to show on the left and right of the current
$a['end_size'] = 1; //how many links to show in the beginning and end
$a['prev_text'] = ''; //text of the "Previous page" link
$a['next_text'] = ''; //text of the "Next page" link
if ($max > 1) {
echo '
' );
} elseif ( is_tag() ) {
$tag_description = tag_description();
if ( ! empty( $tag_description ) )
echo apply_filters( 'tag_archive_meta', '
';
}
$slider_ .= '
';
}
} else {
$slider_ = '';
foreach ($theme_options['slides'] as $key=>$slide) {
$val = wp_get_attachment_image_src( esc_attr($slide['attach_id']), 'main-slider');
$path_to_img = esc_url_raw($val[0]);
if (!empty($slide['link'])) {
if (!empty($slide['is_blank'])) {
$slider_ .= '';
} else {
$slider_ .= '';
}
$slider_ .= '
';
$slider_ .= '';
} else {
$slider_ .= '
';
}
}
$slider_ .= '
';
$slider_ .= '';
$slider_ .= ' ';
$slider_ .= '
';
}
} else {
$slider_ = ''. __('Please add images for slider in theme options!', 'fruitful') .'
';
$slider_ .= ' ';
$slider_ .= '
';
}
if (!empty($slider_layout)) {
if ($slider_layout != 1) {
$slider_ = ''. __('Please add images for slider in theme options!', 'fruitful') .'
' . $slider_ . '
'.$slider_.'
';
}
}
}
/*Get logo img*/
if (!function_exists('fruitful_get_logo')) {
function fruitful_get_logo () {
$theme_options = fruitful_get_theme_options();
if (!empty($theme_options['logo_w'])) {$logo_w = intval($theme_options['logo_w']); }
if (!empty($theme_options['logo_h'])) {$logo_h = intval($theme_options['logo_h']); }
$url_logo = $url_retina_logo = '';
if (!empty($theme_options['logo_img'])) { $url_logo_id = esc_attr($theme_options['logo_img']); } else { $url_logo_id = ''; }
if (!empty($logo_w)) { $logo_width = $logo_w; } else { $logo_width = ''; }
if (!empty($logo_h)) { $logo_height = $logo_h; } else { $logo_height = ''; }
if (!empty($theme_options['logo_img_retina'])) { $url_retina_logo_id = esc_attr($theme_options['logo_img_retina']); } else { $url_retina_logo_id = ''; }
if (!empty($logo_w)) { $logo_retina_width = $logo_width; } else { $logo_retina_width = ''; }
if (!empty($logo_h)) { $logo_retina_height = $logo_height; } else { $logo_retina_height = ''; }
/*Full Backend Options*/
$description = $name = '';
$description = esc_attr(get_bloginfo('description'));
$name = esc_attr(get_bloginfo('name'));
if (!empty($url_logo_id) || !empty($url_retina_logo_id)) {
$url_logo = wp_get_attachment_image_src($url_logo_id, 'full');
if (!empty($url_logo)) {
$image_link = esc_url_raw($url_logo[0]);
}
else {
$image_link = $url_logo_id;
}
$url_retina_logo = wp_get_attachment_image_src($url_retina_logo_id, 'full');
if (!empty($url_retina_logo)) {
$image_link_retina = esc_url_raw($url_retina_logo[0]);
}
else {
$image_link_retina = $url_retina_logo_id;
}
if (!empty($url_logo_id)) echo ''. $name .'
'. $description .'
'; } } } /*Get Favicon*/ if (!function_exists('fruitful_get_favicon')) { function fruitful_get_favicon () { $out_fav_html = null; $url_favicon = $fav_icon_iphone = $fav_icon_iphone_retina = $fav_icon_ipad = $fav_icon_ipad_retina = null; $theme_options = fruitful_get_theme_options(); if (isset($theme_options['fav_icon'])) { $fav_icon_url = esc_attr($theme_options['fav_icon']); $fav_icon_id = wp_get_attachment_image_src($fav_icon_url, 'full'); if (!empty($fav_icon_id)) { $image_link = esc_url_raw($fav_icon_id[0]); } else { $image_link = $fav_icon_url; } $out_fav_html .= ''; $out_fav_html .= ''; } if (isset($theme_options['fav_icon_iphone'])) { $fav_icon_iphone_url = esc_attr($theme_options['fav_icon_iphone']); $fav_icon_iphone_id = wp_get_attachment_image_src($fav_icon_iphone_url, 'full'); if (!empty($fav_icon_iphone_id)) { $image_link = esc_url_raw($fav_icon_iphone_id[0]); } else { $image_link = $fav_icon_iphone_url; } $out_fav_html .= ''; } if (isset($theme_options['fav_icon_iphone_retina'])) { $fav_icon_iphone_retina_url = esc_attr($theme_options['fav_icon_iphone_retina']); $fav_icon_iphone_retina_id = wp_get_attachment_image_src($fav_icon_iphone_retina_url, 'full'); if (!empty($fav_icon_iphone_retina_id)) { $image_link = esc_url_raw($fav_icon_iphone_retina_id[0]); } else { $image_link = $fav_icon_iphone_retina_url; } $out_fav_html .= ''; } if (isset($theme_options['fav_icon_ipad'])) { $fav_icon_ipad_url = esc_attr($theme_options['fav_icon_ipad']); $fav_icon_ipad_id = wp_get_attachment_image_src($fav_icon_ipad_url, 'full'); if (!empty($fav_icon_ipad_id)) { $image_link = esc_url_raw($fav_icon_ipad_id[0]); } else { $image_link = $fav_icon_ipad_url; } $out_fav_html .= ''; } if (isset($theme_options['fav_icon_ipad_retina'])) { $fav_icon_ipad_retina_url = esc_attr($theme_options['fav_icon_ipad_retina']); $fav_icon_ipad_retina_id = wp_get_attachment_image_src($fav_icon_ipad_retina_url, 'full'); if (!empty($fav_icon_ipad_retina_id)) { $image_link = esc_url_raw($fav_icon_ipad_retina_id[0]); } else { $image_link = $fav_icon_ipad_retina_url; } $out_fav_html .= ''; } echo $out_fav_html; } } /*Get footer text*/ if (!function_exists('fruitful_get_footer_text')) { function fruitful_get_footer_text () { $out_footer_text = $footer_text = ''; $theme_options = fruitful_get_theme_options(); if (!empty($theme_options['footer_text'])) { $footer_text = fruitful_kses_data(stripslashes($theme_options['footer_text'])); if (is_home() || is_front_page()) { $out_footer_text .= $footer_text; } else { $out_footer_text .= '' . $out . '
';
}
}
/*Enable Comment*/
if ( ! function_exists( 'fruitful_state_post_comment' ) ) {
function fruitful_state_post_comment () {
$theme_options = fruitful_get_theme_options();
if (!empty($theme_options['postcomment'])) {
return ($theme_options['postcomment'] == "on");
} else {
return false;
}
}
}
if ( ! function_exists( 'fruitful_state_page_comment' ) ) {
function fruitful_state_page_comment () {
$theme_options = fruitful_get_theme_options();
if (!empty($theme_options['pagecomment'])) {
return ($theme_options['pagecomment'] == "on");
} else {
return false;
}
}
}
/*Compress code*/
if ( ! function_exists( 'fruitful_compress_code' ) ) {
function fruitful_compress_code($code) {
$code = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $code);
$code = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $code);
return $code;
}
}
if ( ! function_exists( 'fruitful_hex2rgb' ) ) {
function fruitful_hex2rgb( $colour ) {
if ( $colour[0] == '#' ) {
$colour = substr( $colour, 1 );
}
if ( strlen( $colour ) == 6 ) {
list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );
} elseif ( strlen( $colour ) == 3 ) {
list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );
} else {
return false;
}
$r = hexdec( $r );
$g = hexdec( $g );
$b = hexdec( $b );
return array( 'red' => $r, 'green' => $g, 'blue' => $b );
}
}
if ( ! function_exists( 'fruitful_get_responsive_style' ) ) {
function fruitful_get_responsive_style () {
$style_ = $back_style = $woo_style_ = '';
$theme_options = fruitful_get_theme_options();
fruitful_add_custom_fonts();
if (isset($theme_options['responsive']) && ($theme_options['responsive'] == 'on')) {
if (class_exists('woocommerce')){wp_enqueue_style( 'woo-style', get_template_directory_uri() . '/woocommerce/woo.css');}
if (!class_exists('ffs')){
wp_enqueue_style('fontawesome-style', get_template_directory_uri() . '/css/font-awesome.min.css');
}
wp_enqueue_style('main-style', get_stylesheet_uri());
} else {
if (class_exists('woocommerce')){wp_enqueue_style( 'woo-style', get_template_directory_uri() . '/woocommerce/woo-fixed.css');}
if (!class_exists('ffs')){
wp_enqueue_style('fontawesome-style', get_stylesheet_directory_uri() . '/css/font-awesome.min.css');
}
wp_enqueue_style('main-style', get_stylesheet_directory_uri() .'/fixed-style.css');
}
//if (!empty($theme_options['styletheme'])) {
//if ($theme_options['styletheme'] == 'off') {
$style_ .= 'h1 {font-size : '.esc_attr($theme_options['h1_size']) .'px; }' . "\n";
$style_ .= 'h2 {font-size : '.esc_attr($theme_options['h2_size']) .'px; }' . "\n";
$style_ .= 'h3 {font-size : '.esc_attr($theme_options['h3_size']) .'px; }' . "\n";
$style_ .= 'h4 {font-size : '.esc_attr($theme_options['h4_size']) .'px; }' . "\n";
$style_ .= 'h5 {font-size : '.esc_attr($theme_options['h5_size']) .'px; }' . "\n";
$style_ .= 'h6 {font-size : '.esc_attr($theme_options['h6_size']) .'px; }' . "\n";
$style_ .= 'h1, h2, h3, h4, h5, h6 {font-family : '. esc_attr($theme_options['h_font_family']) .'; } ' . "\n";
$style_ .= '.main-navigation a {font-family : '. esc_attr($theme_options['m_font_family']) .'; color : '.esc_attr($theme_options['menu_font_color']). '; } ' . "\n";
$style_ .= '.main-navigation ul:not(.sub-menu) > li > a, .main-navigation ul:not(.sub-menu) > li:hover > a { font-size : '.esc_attr($theme_options['m_size']) .'px; } ' . "\n";
if (!empty($theme_options['menu_bg_color'])) { $style_ .= '.main-navigation {background-color : ' .esc_attr($theme_options['menu_bg_color']) . '; }' . "\n"; }
$style_ .= '#header_language_select a {font-family : '. esc_attr($theme_options['m_font_family']) .';} ' . "\n";
$style_ .= 'body {font-size : '. esc_attr($theme_options['p_size']) .'px; font-family : ' . esc_attr($theme_options['p_font_family']) . '; }' . "\n";
if(!empty($theme_options['background_color'])) { $back_style .= ' background-color : '. esc_attr($theme_options['background_color']) .'; '; }
if(!empty($theme_options['backgroung_img'])) {
$bg_url = esc_attr($theme_options['backgroung_img']);
$image_attributes = wp_get_attachment_image_src($bg_url, 'full');
if (!empty($image_attributes)) {
$image_link = esc_url_raw($image_attributes[0]);
}
else {
$image_link = $bg_url;
}
if(isset($theme_options['bg_repeating']) && ($theme_options['bg_repeating'] == 'on')) {
$back_style .= 'background-image : url(' .$image_link .'); background-repeat : repeat; ';
} else {
$back_style .= 'background-image : url(' .$image_link .'); background-repeat : no-repeat; background-size:100% 100%; background-size:cover; background-attachment:fixed; ';
}
}
$style_ .= 'body {'. $back_style .'}' . "\n";
if(!empty($theme_options['container_bg_color'])) {
$style_ .= '.page-container .container {background-color : '. esc_attr($theme_options['container_bg_color']) . '; } ' . "\n";
}
/*Header styles*/
if (($theme_options['header_bg_color']) != null) { $style_ .= '.head-container, .head-container.fixed {background-color : ' .esc_attr($theme_options['header_bg_color']) . '; }' . "\n"; }
if (!empty($theme_options['header_img'])) {
$header_url = wp_get_attachment_image_src(intval($theme_options['header_img']), 'full');
if (!empty($header_url)) {
$image_link = esc_url_raw($header_url[0]);
}
else {
$image_link = $theme_options['header_img'];
}
$style_ .= '.head-container {background-image : url(' .esc_attr($image_link) . '); } ' . "\n";
if (!empty($theme_options['header_img_size'])){
if ($theme_options['header_img_size'] == 'full'){
$style_ .= '.head-container {background-size :cover; background-position:center center;} ' . "\n";
} else {
$style_ .= '@media only screen and (max-width:480px){'."\n";
$style_ .= '.head-container {background-size :300px; background-position:top center;} ' . "\n";
$style_ .= '}'."\n";
$style_ .= '@media only screen and (min-width:481px) and (max-width:767px){'."\n";
$style_ .= '.head-container {background-size :420px; background-position:top center;} ' . "\n";
$style_ .= '}'."\n";
$style_ .= '@media only screen and (min-width:768px) and (max-width:959px){'."\n";
$style_ .= '.head-container {background-size :768px; background-position:top center;} ' . "\n";
$style_ .= '}'."\n";
$style_ .= '@media only screen and (min-width:960px){'."\n";
$style_ .= '.head-container {background-size :960px; background-position:top center;} ' . "\n";
$style_ .= '}'."\n";
}
}
}
if (!empty($theme_options['header_height'])) {
$style_ .= '.head-container {min-height : '.esc_attr($theme_options['header_height']).'px; }' . "\n";
}
if (!empty($theme_options['is_fixed_header'])) {
if (isset($theme_options['is_fixed_header']) && ($theme_options['is_fixed_header'] == 'on')) {
$style_ .= '.head-container {position : fixed; }' . "\n";
} else {
$style_ .= '.head-container {position : relative; }' . "\n";
}
}
if (!empty($theme_options['logo_h'])) {
$style_ .= '.site-header img {max-height : '.esc_attr($theme_options['logo_h']).'px; }' . "\n";
}
if (!empty($theme_options['logo_retina_h'])) {
$style_ .= '.site-header img {max-height : '.esc_attr($theme_options['logo_retina_h']).'px; }' . "\n";
}
/*end of header styles*/
if (!empty($theme_options['menu_btn_color'])) { $style_ .= '.main-navigation ul li.current_page_item a, .main-navigation ul li.current-menu-ancestor a, .main-navigation ul li.current-menu-item a, .main-navigation ul li.current-menu-parent a, .main-navigation ul li.current_page_parent a {background-color : '.esc_attr($theme_options['menu_btn_color']) . '; }' . "\n"; }
if (!empty($theme_options['menu_hover_color'])) { $style_ .= '.main-navigation ul li.current_page_item a, .main-navigation ul li.current-menu-ancestor a, .main-navigation ul li.current-menu-item a, .main-navigation ul li.current-menu-parent a, .main-navigation ul li.current_page_parent a {color : '.esc_attr($theme_options['menu_hover_color']) . '; } ' . "\n"; }
$style_ .= '.main-navigation ul > li:hover>a {' . "\n";
if (!empty($theme_options['menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['menu_btn_color']) . '; ' . "\n"; }
if (!empty($theme_options['menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['menu_hover_color']) . '; ' . "\n"; }
$style_ .= ' } ' . "\n";
/*styles for dropdown menu*/
$style_ .= '#masthead .main-navigation ul > li > ul > li > a {' . "\n";
if (!empty($theme_options['dd_menu_bg_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_bg_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_font_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_font_color']) . '; ' . "\n"; }
$style_ .= ' } ' . "\n";
$style_ .= '#masthead .main-navigation ul > li > ul > li:hover > a {' . "\n";
if (!empty($theme_options['dd_menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_btn_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_hover_color']) . '; ' . "\n"; }
$style_ .= ' } ' . "\n";
$style_ .= '#masthead .main-navigation ul > li ul > li.current-menu-item > a {' . "\n";
if (!empty($theme_options['dd_menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_btn_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_hover_color']) . '; ' . "\n"; }
$style_ .= ' } ' . "\n";
$style_ .= '#masthead div .main-navigation ul > li > ul > li > ul a {' . "\n";
if (!empty($theme_options['dd_menu_bg_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_bg_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_font_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_font_color']) . '; ' . "\n"; }
$style_ .= ' } ' . "\n";
$style_ .= '#masthead div .main-navigation ul > li > ul > li ul li:hover a {' . "\n";
if (!empty($theme_options['dd_menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_btn_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_hover_color']) . '; ' . "\n"; }
$style_ .= ' } ' . "\n";
$style_ .= '#lang-select-block li ul li a{'. "\n";
if (!empty($theme_options['dd_menu_bg_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_bg_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_font_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_font_color']) . '; ' . "\n"; }
$style_ .= '}' . "\n";
$style_ .= '#lang-select-block li ul li a:hover{'. "\n";
if (!empty($theme_options['dd_menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_btn_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_hover_color']) . '; ' . "\n"; }
$style_ .= '}' . "\n";
$style_ .= '#lang-select-block li ul li.active a{'. "\n";
if (!empty($theme_options['dd_menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_btn_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_hover_color']) . '; ' . "\n"; }
$style_ .= '}' . "\n";
/*end of styles for dropdown menu*/
/*styles for responsive full width menu*/
if (!empty($theme_options['menu_type_responsive']) && ($theme_options['menu_type_responsive'] == 'full_width')) {
$style_ .= '.resp_full_width_menu .site-header .menu_wrapper{'. "\n";
if (!empty($theme_options['dd_menu_bg_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_bg_color']) . '; ' . "\n"; }
$style_ .= '}' . "\n";
$style_ .= '.resp_full_width_menu .site-header .menu_wrapper .menu li a{'. "\n";
if (!empty($theme_options['dd_menu_font_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_font_color']) . '; ' . "\n"; }
$style_ .= '}' . "\n";
$style_ .= '.resp_full_width_menu .site-header .menu_wrapper .menu li.current-menu-item>a,'. "\n";
$style_ .= '.resp_full_width_menu .site-header .menu_wrapper .menu li.current_page_item>a,'. "\n";
$style_ .= '.resp_full_width_menu .site-header .menu_wrapper .menu a:hover{'. "\n";
if (!empty($theme_options['dd_menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['dd_menu_btn_color']) . '; ' . "\n"; }
if (!empty($theme_options['dd_menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['dd_menu_hover_color']) . '; ' . "\n"; }
$style_ .= '}' . "\n";
}
/*end of styles for responsive full width menu*/
$style_ .= '#header_language_select ul li.current > a { color : '.esc_attr($theme_options['menu_font_color']). '; } ' . "\n";
if (!empty($theme_options['menu_bg_color'])) { $style_ .= '#header_language_select { background-color : '.esc_attr($theme_options['menu_bg_color']) . '; } ' . "\n"; }
$style_ .= '#header_language_select ul li.current:hover > a { ' . "\n";
if (!empty($theme_options['menu_btn_color'])) { $style_ .= 'background-color : '. esc_attr($theme_options['menu_btn_color']) . ';' . "\n"; }
if (!empty($theme_options['menu_hover_color'])) { $style_ .= 'color : '.esc_attr($theme_options['menu_hover_color']) . ';' . "\n"; }
$style_ .= '} ' . "\n";
/*Add Custom Colors to theme*/
if (!empty($theme_options['p_font_color'])) { $style_ .= 'body {color : '. esc_attr($theme_options['p_font_color']) .'; } ' . "\n"; }
if (!empty($theme_options['widgets_sep_color'])) {
$style_ .= '#page .container #secondary .widget h3.widget-title, #page .container #secondary .widget h1.widget-title, header.post-header .post-title {border-color : '. esc_attr($theme_options['widgets_sep_color']) .'; } ' . "\n";
$style_ .= 'body.single-product #page .related.products h2 {border-bottom-color : '. esc_attr($theme_options['widgets_sep_color']) .'; } ' . "\n";
}
if (!empty($theme_options['a_font_color'])) {
$a_font_color = esc_attr($theme_options['a_font_color']);
$style_ .= 'a {color : '.$a_font_color.'; }';
$style_ .= '#page .container #secondary>.widget_nav_menu>div>ul>li ul>li>a:before {color : '.$a_font_color.'; }';
$style_ .= '#page .container #secondary .widget ul li.cat-item a:before {color : '.$a_font_color.'; }';
$style_ .= 'html[dir="rtl"] #page .container #secondary>.widget_nav_menu>div>ul>li ul>li>a:after {color : '. $a_font_color .'; }';
$style_ .= 'html[dir="rtl"] #page .container #secondary .widget ul li.cat-item a:after {color : '. $a_font_color .'; }';
}
if (!empty($theme_options['a_hover_font_color'])) {
$style_ .= 'a:hover {color : '. esc_attr($theme_options['a_hover_font_color']) .'; } ' . "\n";
$style_ .= '#page .container #secondary>.widget_nav_menu li.current-menu-item>a {color : '. esc_attr($theme_options['a_hover_font_color']) .'; } ';
$style_ .= '#page .container #secondary>.widget_nav_menu>div>ul>li ul>li>a:hover:before,
#page .container #secondary>.widget_nav_menu>div>ul>li ul>li.current-menu-item>a:before,
#page .container #secondary>.widget_nav_menu>div>ul>li ul>li.current-menu-item>a:hover:before{color : '. esc_attr($theme_options['a_hover_font_color']) .'; }';
$style_ .= '#page .container #secondary .widget ul li.current-cat>a,
#page .container #secondary .widget ul li.cat-item ul li.current-cat a:before,
#page .container #secondary .widget ul li.cat-item a:hover:before{color : '. esc_attr($theme_options['a_hover_font_color']) .'; }';
$style_ .= 'html[dir="rtl"] #page .container #secondary>.widget_nav_menu>div>ul>li ul>li>a:hover:after,';
$style_ .= 'html[dir="rtl"] #page .container #secondary>.widget_nav_menu>div>ul>li ul>li.current-menu-item>a:after,';
$style_ .= 'html[dir="rtl"] #page .container #secondary>.widget_nav_menu>div>ul>li ul>li.current-menu-item>a:hover:after{color : '. esc_attr($theme_options['a_hover_font_color']) .'; } ' . "\n";
$style_ .= 'html[dir="rtl"] #page .container #secondary .widget ul li.current-cat>a,
html[dir="rtl"] #page .container #secondary .widget ul li.current-cat>a:after,
html[dir="rtl"] #page .container #secondary .widget ul li.cat-item a:hover:after{color : '. esc_attr($theme_options['a_hover_font_color']) .'; } ';
}
if (!empty($theme_options['a_focus_font_color'])) { $style_ .= 'a:focus {color : '. esc_attr($theme_options['a_focus_font_color']) .'; } ' . "\n"; }
if (!empty($theme_options['a_active_font_color'])) { $style_ .= 'a:active {color : '. esc_attr($theme_options['a_active_font_color']) .'; } ' . "\n"; }
if (!empty($theme_options['date_of_post_b_color'])) {
$style_ .= '.blog_post .date_of_post {background : none repeat scroll 0 0 '. esc_attr($theme_options['date_of_post_b_color']) .'; } ' . "\n";
}
if (!empty($theme_options['date_of_post_f_color'])) {
$style_ .= '.blog_post .date_of_post {color : '. esc_attr($theme_options['date_of_post_f_color']) .'; } ' . "\n";
}
//$woo_style_ .= '.num_of_product_cart {border-color: '. esc_attr($theme_options['menu_btn_color']) . '; } ' . "\n";
if (!empty($theme_options['cart_color'])) {
$woo_style_ .= '.cart_image {color: '. esc_attr($theme_options['cart_color']) . '; } ' . "\n";
$woo_style_ .= '.num_of_product_cart {border-color: '. esc_attr($theme_options['cart_color']) . '; } ' . "\n";
}
if (!empty($theme_options['btn_color'])) {
$btn_color = esc_attr($theme_options['btn_color']);
$style_ .= 'button, input[type="button"], input[type="submit"], input[type="reset"]{background-color : '.$btn_color.' !important; } ';
$style_ .= 'body a.btn.btn-primary, body button.btn.btn-primary, body input[type="button"].btn.btn-primary , body input[type="submit"].btn.btn-primary {background-color : '.$btn_color.' !important; }';
$woo_style_ .= '.woocommerce table.my_account_orders .order-actions .button, .woocommerce-page table.my_account_orders .order-actions .button{background-color : '.$btn_color.' !important; }';
$style_ .= '.nav-links.shop .pages-links .page-numbers, .nav-links.shop .nav-next a, .nav-links.shop .nav-previous a{background-color : '.$btn_color.' !important; }';
}
if (!empty($theme_options['btn_active_color'])) {
$btn_active_color = esc_attr($theme_options['btn_active_color']);
$style_ .= 'button:hover, button:active, button:focus{background-color : '.$btn_active_color.' !important; }';
$style_ .= 'input[type="button"]:hover, input[type="button"]:active, input[type="button"]:focus{background-color : '.$btn_active_color.' !important; }';
$style_ .= 'input[type="submit"]:hover, input[type="submit"]:active, input[type="submit"]:focus{background-color : '.$btn_active_color.' !important; }';
$style_ .= 'input[type="reset"]:hover, input[type="reset"]:active, input[type="reset"]:focus{background-color : '.$btn_active_color.' !important; }';
$style_ .= 'body a.btn.btn-primary:hover, body button.btn.btn-primary:hover, body input[type="button"].btn.btn-primary:hover , body input[type="submit"].btn.btn-primary:hover {background-color : '.$btn_active_color.' !important; }';
$woo_style_ .= '.woocommerce table.my_account_orders .order-actions .button:hover, .woocommerce-page table.my_account_orders .order-actions .button:hover{background-color : '.$btn_active_color.' !important; }';
$style_ .= '.nav-links.shop .pages-links .page-numbers:hover, .nav-links.shop .nav-next a:hover, .nav-links.shop .nav-previous a:hover, .nav-links.shop .pages-links .page-numbers.current{background-color : '.$btn_active_color.' !important; }';
}
/*social icons styles*/
if (!empty($theme_options['soc_icon_bg_color'])) {
$style_ .= '.social-icon>a>i{background:'.$theme_options['soc_icon_bg_color'].'}' . "\n";
}
if (!empty($theme_options['soc_icon_color'])) {
$style_ .= '.social-icon>a>i{color:'.$theme_options['soc_icon_color'].'}' . "\n";
}
/*Woocommerce styles*/
if (class_exists('woocommerce')){
if (!empty($theme_options['woo_shop_sidebar']) && !is_tax('product_tag')){
$shop_sidebar_template = $theme_options['woo_shop_sidebar'];
if ($shop_sidebar_template == 3){ /*right sidebar template*/
$woo_style_ .= '#page .container .woo-loop-content{float:left}'."\n";
$woo_style_ .= '#page .container .woo-loop-sidebar{float:right}'."\n";
$woo_style_ .= '#page .container .woo-loop-sidebar #secondary{float:right}'."\n";
$woo_style_ .= '.woocommerce .woocommerce-ordering, .woocommerce-page .woocommerce-ordering{float:left}'."\n";
} else {
$woo_style_ .= '#page .container .woo-loop-content{float:right}'."\n";
$woo_style_ .= '#page .container .woo-loop-sidebar{float:left}'."\n";
$woo_style_ .= '#page .container .woo-loop-sidebar #secondary{float:left}'."\n";
$woo_style_ .= '.woocommerce .woocommerce-ordering, .woocommerce-page .woocommerce-ordering{float:right}'."\n";
}
}
if (!empty($theme_options['woo_product_sidebar'])){
$product_sidebar_template = $theme_options['woo_product_sidebar'];
if ($product_sidebar_template == 3){ /*right sidebar template*/
$woo_style_ .= '.single-product #page .container .woo-loop-content{float:left}'."\n";
$woo_style_ .= '.single-product #page .container .woo-loop-sidebar{float:right}'."\n";
$woo_style_ .= '.single-product #page .container .woo-loop-sidebar #secondary{float:right}'."\n";
} else {
$woo_style_ .= '.single-product #page .container .woo-loop-content{float:right}'."\n";
$woo_style_ .= '.single-product #page .container .woo-loop-sidebar{float:left}'."\n";
$woo_style_ .= '.single-product #page .container .woo-loop-sidebar #secondary{float:left}'."\n";
}
}
/*price color*/
if (!empty($theme_options['a_hover_font_color'])) {
$woo_style_ .= '.woocommerce ul.products li.product .price ,
.woocommerce-page ul.products li.product .price,
body.woocommerce div.product span.price,
body.woocommerce-page div.product span.price,
body.woocommerce #content div.product span.price,
body.woocommerce-page #content div.product span.price,
body.woocommerce div.product p.price,
body.woocommerce-page div.product p.price,
body.woocommerce #content div.product p.price,
body.woocommerce-page #content div.product p.price{color : '. esc_attr($theme_options['a_hover_font_color']) .'; }';
}
/*buttons color*/
if (!empty($theme_options['btn_color'])) {
$btn_color = esc_attr($theme_options['btn_color']);
$woo_style_ .= '.woocommerce .woocommerce-message, .woocommerce-page .woocommerce-message{border-top:3px solid '.$btn_color.';}';
$woo_style_ .= '.woocommerce .woocommerce-info, .woocommerce-page .woocommerce-info{border-top:3px solid '.$btn_color.';}';
$woo_style_ .= '.single-product .woocommerce-message .button{background-color:'.$btn_color.';}';
}
/*buttons hover color*/
if (!empty($theme_options['btn_active_color']))
$woo_style_ .= '.single-product .woocommerce-message .button:hover{background-color:'.esc_attr($theme_options['btn_active_color']).';}';
if (!empty($theme_options['woo_sale_price_color'])) {
$color_rgba = fruitful_hex2rgb($theme_options['woo_sale_price_color']);
$color = $color_rgba['red'] . ',' . $color_rgba['green'] . ',' . $color_rgba['blue'];
$woo_style_ .= '.woocommerce ul.products li.product .price del, .woocommerce-page ul.products li.product .price del {color:rgba('.$color.',.5); }';
}
if (!empty($theme_options['woo_rating_color_regular'])) {
$woo_style_ .= '.woocommerce .star-rating, .woocommerce-page .star-rating,
.woocommerce p.stars a.star-1,
.woocommerce p.stars a.star-2,
.woocommerce p.stars a.star-3,
.woocommerce p.stars a.star-4,
.woocommerce p.stars a.star-5,
.woocommerce-page p.stars a.star-1,
.woocommerce-page p.stars a.star-2,
.woocommerce-page p.stars a.star-3,
.woocommerce-page p.stars a.star-4,
.woocommerce-page p.stars a.star-5 {
color:' .esc_attr($theme_options['woo_rating_color_regular']). '; }';
}
if (!empty($theme_options['woo_rating_color_active'])) {
$woo_style_ .= '.woocommerce p.stars a.star-1:hover,
.woocommerce p.stars a.star-2:hover,
.woocommerce p.stars a.star-3:hover,
.woocommerce p.stars a.star-4:hover,
.woocommerce p.stars a.star-5:hover,
.woocommerce-page p.stars a.star-1:hover,
.woocommerce-page p.stars a.star-2:hover,
.woocommerce-page p.stars a.star-3:hover,
.woocommerce-page p.stars a.star-4:hover,
.woocommerce-page p.stars a.star-5:hover,
.woocommerce .star-rating:hover, .woocommerce-page .star-rating:hover { color:' .esc_attr($theme_options['woo_rating_color_active']). '; }';
}
}
if (class_exists('BuddyPress')){
if (!empty($theme_options['btn_color'])) {
$style_ .= '#buddypress input[type=submit]{background-color : '.esc_attr($theme_options['btn_color']).' !important; } ' . "\n";
}
if (!empty($theme_options['btn_active_color'])) {
$style_ .= '#buddypress input[type=submit]:hover, #buddypress input[type=submit]:active, #buddypress input[type=submit]:focus{background-color : '.esc_attr($theme_options['btn_active_color']).' !important; } ' . "\n";
}
}
//}
//else {
//$style_ .= 'body {font-family:Open Sans, sans-serif}' . "\n";
//}
//}
if (!empty($theme_options['custom_css'])) {
$style_ .= wp_kses_stripslashes($theme_options['custom_css']) . "\n";
}
wp_add_inline_style( 'main-style', fruitful_compress_code($style_));
if ($woo_style_ != '') {
wp_add_inline_style( 'woo-style', fruitful_compress_code($woo_style_));
}
}
add_action('wp_enqueue_scripts', 'fruitful_get_responsive_style', 99);
}
if ( ! function_exists( 'fruitful_get_sliders' ) ) {
function fruitful_get_sliders() {
global $post;
$prefix = '_fruitful_';
$theme_options = fruitful_get_theme_options();
$front_page_id = get_option('page_on_front');
$blog_page_id = get_option('page_for_posts ');
$slider_layout = 0;
if (is_page() && !is_front_page() && !is_home()) {
$slider_layout = get_post_meta( $post->ID, $prefix . 'slider_layout', true);
} elseif(!is_front_page() && is_home() && ($blog_page_id != 0)) {
/*Only for blog posts loop*/
$slider_layout = get_post_meta( $blog_page_id, $prefix . 'slider_layout', true);
} elseif (is_front_page()) {
$slider_layout = get_post_meta( $front_page_id, $prefix . 'slider_layout', true);
}
if ($slider_layout){
if (!empty($theme_options['select_slider'])) {
if ($theme_options['select_slider'] == "1") {
echo fruitful_get_slider_layout_flex();
} else if ($theme_options['select_slider'] == "2") {
echo fruitful_get_slider_layout_nivo();
}
}
}
}
}
/* Woocommerce functions */
if (class_exists('Woocommerce')) {
/*change number of products per row shop page*/
add_filter('loop_shop_columns', 'fruitful_loop_columns');
if (!function_exists('fruitful_loop_columns')) {
function fruitful_loop_columns() {
$theme_options = fruitful_get_theme_options();
if (!empty($theme_options['shop_num_row'])){
return esc_attr($theme_options['shop_num_row']);
} else {
return '4';
}
}
}
/*change number of products per page shop page*/
add_filter( 'loop_shop_per_page', 'fruitful_loop_shop_per_page', 20);
if (!function_exists('fruitful_loop_shop_per_page')) {
function fruitful_loop_shop_per_page(){
$theme_options = fruitful_get_theme_options();
$woo_shop_num_prod = get_option('posts_per_page');
if (!empty($theme_options['woo_shop_num_prod'])) $woo_shop_num_prod = esc_attr($theme_options['woo_shop_num_prod']);
return $woo_shop_num_prod;
}
}
/*remove sidebar from all woocommerce pages except shop page*/
add_action( 'wp', 'init' );
function init() {
if ( !is_shop() && !is_product_category()) {
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
}
}
/*remove woocommerce sidebar on some pages*/
add_action('template_redirect', 'fruitful_remove_woo_sidebar');
if (!function_exists('fruitful_remove_woo_sidebar')) {
function fruitful_remove_woo_sidebar() {
if (fruitful_get_woo_sidebar() == 1){
remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar');
}
}
}
/*check is woocommerce sidebar will be hidden*/
if (!function_exists('fruitful_get_woo_sidebar')) {
function fruitful_get_woo_sidebar() {
$woo_sidebar = 2;
if ( is_shop() || is_product_category() || is_tax('product_tag')) {
$theme_options = fruitful_get_theme_options();
if (!empty($theme_options['woo_shop_sidebar'])){
$woo_sidebar = esc_attr($theme_options['woo_shop_sidebar']);
}
}
if ( is_product() ) {
$theme_options = fruitful_get_theme_options();
if (!empty($theme_options['woo_product_sidebar'])){
$woo_sidebar = esc_attr($theme_options['woo_product_sidebar']);
}
}
return $woo_sidebar;
}
}
/*rewrite pagenavi for woocommerce*/
remove_action('woocommerce_pagination', 'woocommerce_pagination', 10);
add_action( 'woocommerce_pagination', 'woocommerce_pagination', 10);
if ( ! function_exists( 'woocommerce_pagination' ) ) {
function woocommerce_pagination() {
fruitful_wp_corenavi();
}
}
/*change title in tabs on single product page*/
add_filter('woocommerce_product_description_heading','fruitful_product_description_heading');
function fruitful_product_description_heading() {
return '';
}
/*4 cross products for cart*/
remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
add_action( 'woocommerce_cart_collaterals', 'fruitful_woocommerce_cross_sell_display' );
if ( ! function_exists( 'fruitful_woocommerce_cross_sell_display' ) ) {
function fruitful_woocommerce_cross_sell_display() {
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce_loop, $woocommerce, $product;
$crosssells = $woocommerce->cart->get_cross_sells();
if ( sizeof( $crosssells ) == 0 ) return;
$meta_query = $woocommerce->query->get_meta_query();
$args = array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'posts_per_page' => apply_filters( 'woocommerce_cross_sells_total', 4 ),
'no_found_rows' => 1,
'orderby' => 'rand',
'post__in' => $crosssells,
'meta_query' => $meta_query
);
$products = new WP_Query( $args );
$woocommerce_loop['columns'] = apply_filters( 'woocommerce_cross_sells_columns', 4 );
if ( $products->have_posts() ) : ?>
have_posts() ) : $products->the_post(); ?>
$posts_per_page,
'columns' => $columns,
'orderby' => $orderby,
);
$defaults = array(
'posts_per_page' => 2,
'columns' => 2,
'orderby' => 'rand'
);
$args = wp_parse_args( $args, $defaults );
wc_get_template( 'single-product/related.php', $args );
}
}
/*Update cart contents update when products are added to the cart via AJAX */
add_filter('add_to_cart_fragments', 'fruitful_woocommerce_header_add_to_cart_fragment');
if ( ! function_exists( 'fruitful_woocommerce_header_add_to_cart_fragment' ) ) {
function fruitful_woocommerce_header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
$out = '';
$out .= '';
$out .= '';
$out .= sprintf(_n('%d ', '%d ', $woocommerce->cart->cart_contents_count, 'fruitful'), $woocommerce->cart->cart_contents_count) .'';
$fragments['a.cart-contents'] = $out;
return $fragments;
}
}
}
if ( ! function_exists( 'fruitful_custom_css_and_slider_scripts' ) ) {
function fruitful_custom_css_and_slider_scripts() {
echo '';
}
add_action('wp_head', 'fruitful_custom_css_and_slider_scripts', 25);
}
if ( ! function_exists( 'fruitful_entry_meta' ) ) {
function fruitful_entry_meta() {
?>
',
esc_url( get_permalink() ),
esc_attr( sprintf( __( 'Permalink to %s', 'fruitful' ), the_title_attribute( 'echo=0' ) ) ),
esc_attr( get_the_date( 'c' ) ),
esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
);
if ($echo ) echo $date;
return $date;
}
}
if ( ! function_exists( 'fruitful_theme_options_validate' ) ) {
function fruitful_theme_options_validate($value) {
return $value;
}
}
if ( ! function_exists( 'fruitful_customize_preview_js' ) ) {
function fruitful_customize_preview_js() {
wp_enqueue_script( 'fruitful-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true );
}
add_action( 'customize_preview_init', 'fruitful_customize_preview_js' );
}
if ( ! function_exists( 'fruitful_metadevice' ) ) {
function fruitful_metadevice() {
$browser = '';
$browser_ip = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$browser_an = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$browser_ipad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
if ($browser_ip == true) { $browser = 'iphone'; }
if ($browser_an == true) { $browser = 'android'; }
if ($browser_ipad == true) { $browser = 'ipad'; }
if($browser == 'iphone') { echo ''; }
if($browser == 'android') { echo ''; }
if($browser == 'ipad') { echo ''; }
}
}
add_action( 'wp_head', 'fruitful_metadevice' );
if ( ! function_exists( 'fruitful_esc_content_pbr' ) ) {
function fruitful_esc_content_pbr($content = null) {
$content = preg_replace( '%\s*
%', '', $content ); $Old = array( '', '
' ); $New = array( '','' ); $content = str_replace( $Old, $New, $content ); return $content; } } if ( ! function_exists( 'fruitful_get_class_pos' ) ) { function fruitful_get_class_pos($index) { if ($index == 0) { $pos_class = 'left-pos'; } else if ($index == 1) { $pos_class = 'center-pos'; } else { $pos_class = 'right-pos'; } return esc_attr($pos_class); } } if ( ! function_exists( 'fruitful_kses_data' ) ) { function fruitful_kses_data($text = null) { $allowed_tags = wp_kses_allowed_html( 'post' ); return wp_kses($text, $allowed_tags); } } if ( ! function_exists( 'fruitful_get_languages_list' ) ) { function fruitful_get_languages_list(){ $theme_options = fruitful_get_theme_options(); if( function_exists('icl_get_languages') && $theme_options['is_wpml_ready'] == 'on' ){ $languages = icl_get_languages('skip_missing=0'); if(!empty($languages)){ echo '
- ';
foreach($languages as $l){
if($l['active']) {
echo '
- ';
echo '';
echo $l['language_code'];
echo '';
echo '
- ';
echo '
- '; echo ''; echo $l['native_name']; echo ''; echo ' '; } } foreach($languages as $l){ if(!($l['active'])) { echo '
- '; echo ''; echo $l['native_name']; echo ' '; } } echo '
';
echo '
';
}
if ($total == 1 && $max > 1) {
$pages = 'Page ' . $current . ' of ' . $max . ''."\r\n";
}
echo '
';
}
}
}
/*rewrite get_product_search_form() function*/
if ( ! function_exists( 'fruitful_get_product_search_form' ) ) {
function fruitful_get_product_search_form(){
?>
ID != $blog_id) ) ? true : false ;
}
}
if ( ! function_exists( 'fruitful_get_content_with_custom_sidebar' ) ) {
function fruitful_get_content_with_custom_sidebar($curr_sidebar = null) {
global $post;
function get_content_part() {
global $post;
?>
'; previous_posts_link($next_label); echo '
';
echo '';
echo $pages . paginate_links($a);
echo '
';
echo ''; next_posts_link($prev_label); echo '
';
if ($max > 1) {
echo '
'.__("Front page displays Error.", 'fruitful').' '.__('Select different pages!', 'fruitful').'
';
} else {
if (!is_archive() && !is_search() && !is_404()) {
if (is_home()) {
if ( have_posts() ) :
/* The loop */
while ( have_posts() ) : the_post();
do_action('before_post_content_loop');
get_template_part( 'content', get_post_format() );
do_action('after_post_content_loop');
endwhile;
fruitful_content_nav( 'nav-below' );
else :
get_template_part( 'no-results', 'index' );
endif;
} else {
if ( have_posts() ) {
while ( have_posts() ) : the_post();
if (is_page() && !is_front_page() && !is_home()) {
get_template_part( 'content', 'page' );
if (fruitful_state_page_comment()) {
comments_template( '', true );
}
} else if (is_single()) {
get_template_part( 'content', get_post_format() );
fruitful_content_nav( 'nav-below' );
if (fruitful_state_post_comment()) {
if ( comments_open() || '0' != get_comments_number() ) comments_template();
}
} else if (is_front_page()) {
get_template_part( 'content', 'page' );
}
endwhile;
}
}
} else {
?>
' . $tag_description . '
' );
}
?>