'',
'link' => '',
'new_tab' => true,
)
);
$social_icons = get_theme_mod( 'social_media_links', $social_defaults );
$has_social = false;
if ( is_array( $social_icons ) ){
foreach( $social_icons as $value ){
if( !empty( $value['icon'] ) ){
$has_social = true;
break;
}
}
}
return $has_social;
}
}
if( !function_exists( 'gutener_social' ) ){
/**
* Add social icons.
*
* @since Blog Gutener 1.0.5
*/
function gutener_social(){
echo '';
$count = 0.2;
$social_defaults = array(
array(
'icon' => '',
'link' => '',
'new_tab' => true,
)
);
$social_icons = get_theme_mod( 'social_media_links', $social_defaults );
foreach( $social_icons as $value ){
if( isset( $value['new_tab'] ) && $value['new_tab'] ){
$link_target = '_blank';
}else{
$link_target = '';
}
if( !empty( $value['icon'] ) ){
echo ' ';
$count = $count + 0.2;
}
}
echo '
';
}
}
/**
* Modify excerpt item priority to last in product detail page.
* @since Gutener 1.4.2
*/
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 55 );
/**
* Change column number of related products in product detail page.
*
* @return array
* @since Gutener 1.4.2
*/
if( !function_exists( 'gutener_related_products_args' ) ){
add_filter( 'woocommerce_output_related_products_args', 'gutener_related_products_args', 20 );
function gutener_related_products_args( $args ) {
$args[ 'columns'] = 3;
return $args;
}
}
/**
* Check if WooCommerce is activated and is product detail page.
*
* @return bool
* @since Gutener 1.4.2
*/
if( !function_exists( 'gutener_wooCom_is_product_page' ) ){
function gutener_wooCom_is_product_page() {
if ( class_exists( 'woocommerce' ) ) {
if ( is_product() ) {
return true;
}
}else{
return false;
}
}
add_action( 'wp', 'gutener_wooCom_is_product_page' );
}
/**
* Adds breadcrumb before product title in product detail page.
*
* @since Gutener 1.4.2
*/
if( !function_exists( 'gutener_product_detail_breadcrumb' ) ){
add_action( 'woocommerce_single_product_summary', 'gutener_product_detail_breadcrumb', 1 );
function gutener_product_detail_breadcrumb(){
if( gutener_wooCom_is_product_page() ){
if ( get_theme_mod( 'breadcrumbs_controls', 'disable_in_all_pages' ) == 'disable_in_all_pages' || get_theme_mod( 'breadcrumbs_controls', 'disable_in_all_pages' ) == 'show_in_all_page_post' ){
if( function_exists( 'bcn_display' ) && !is_front_page() ){
navxt_gutener_breadcrumb( false );
}else{
gutener_breadcrumb_wrap();
}
}
}
}
}
/**
* Add left sidebar to product detail page.
*
* @since Gutener 1.4.2
*/
if( !function_exists( 'gutener_woo_product_detail_left_sidebar' ) ){
function gutener_woo_product_detail_left_sidebar( $sidebarColumnClass ){
if( !get_theme_mod( 'disable_sidebar_woocommerce_page', false ) ){
if ( get_theme_mod( 'sidebar_settings', 'no-sidebar' ) == 'left' ){
if( is_active_sidebar( 'woocommerce-left-sidebar' ) ){ ?>
$sidebarClass,
'sidebarColumnClass' => $sidebarColumnClass,
);
return $colClasses;
}
}
/**
* Add wrapper product gallery in product detail page.
*
* @since Gutener 1.4.2
*/
if( !function_exists( 'gutener_woocommerce_before_single_product_summary' ) ){
add_action( 'woocommerce_before_single_product_summary', 'gutener_woocommerce_before_single_product_summary', 5 );
function gutener_woocommerce_before_single_product_summary(){
echo '';
}
}
/**
* Add left sidebar before tabs in product detail page.
*
* @since Gutener 1.4.2
*/
if( !function_exists( 'gutener_woocommerce_after_single_product_summary' ) ){
add_action( 'woocommerce_after_single_product_summary', 'gutener_woocommerce_after_single_product_summary', 5 );
function gutener_woocommerce_after_single_product_summary(){
$getSidebarClass = gutener_get_sidebar_class();
echo '
';/* .product-detail-wrapper */
echo '';
gutener_woo_product_detail_left_sidebar( $getSidebarClass[ 'sidebarColumnClass' ] );
echo '';/* col woocommerce tabs and related products */
echo '
';/* .row */
}
}