Header Image > Gradient * Product Category: Product Category Image > Header Image > Gradient * Shop Page: Shop Page Featured Image > Header Image > Gradient * Blog Page: Page Featured Image > Header Image > Gradient * Single Post: Featured Image > Gradient */ $shop_id = get_option( 'woocommerce_shop_page_id' ); if ( bigbang_woocommerce_check() && is_woocommerce() ) { // Single product page if ( is_product() ) { $terms = get_the_terms( get_queried_object_id(), 'product_cat' ); // If product has categories if ( ! empty( $terms ) ) { foreach ( $terms as $term ) { if ( ! empty( $term->term_id ) ) { $category_thumbnail = get_woocommerce_term_meta( $term->term_id, 'thumbnail_id', true ); } // Get product category's image if ( ! empty( $category_thumbnail ) ) { $thumb_tmp = wp_get_attachment_url( $category_thumbnail ); } // End if(). } } } elseif ( is_product_category() ) { global $wp_query; $category = $wp_query->get_queried_object(); if ( ! empty( $category->term_id ) ) { $thumbnail_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true ); } if ( ! empty( $thumbnail_id ) ) { // Get category featured image $thumb_tmp = wp_get_attachment_url( $thumbnail_id ); } else { if ( ! empty( $shop_id ) ) { // Get shop page featured image $thumb_tmp = get_the_post_thumbnail_url( $shop_id ); if ( ! empty( $thumb_tmp ) ) { $thumbnail = $thumb_tmp; } } } } else { // Shop page if ( ! empty( $shop_id ) ) { // Get shop page featured image $thumb_tmp = get_the_post_thumbnail_url( $shop_id ); } }// End if(). } else { // Get featured image if ( is_home() ) { $page_for_posts_id = get_option( 'page_for_posts' ); if ( ! empty( $page_for_posts_id ) ) { $thumb_tmp = get_the_post_thumbnail_url( $page_for_posts_id ); } } else { $thumb_tmp = get_the_post_thumbnail_url(); } }// End if(). if ( ! empty( $thumb_tmp ) ) { $thumbnail = $thumb_tmp; } return esc_url( apply_filters( 'bigbang_header_image_filter', $thumbnail ) ); } endif; if ( ! function_exists( 'bigbang_logo' ) ) : /** * Display your custom logo if present. * * @since bigbang 1.0 */ function bigbang_logo() { if ( get_theme_mod( 'custom_logo' ) ) { $logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' ); $alt_attribute = get_post_meta( get_theme_mod( 'custom_logo' ), '_wp_attachment_image_alt', true ); if ( empty( $alt_attribute ) ) { $alt_attribute = get_bloginfo( 'name' ); } $logo = '' . esc_attr( $alt_attribute ) . ''; } else { $logo = '

' . get_bloginfo( 'name' ) . '

'; } return $logo; } endif; if ( ! function_exists( 'bigbang_category' ) ) : /** * Display the first category of the post. * * @since bigbang 1.0 */ function bigbang_category() { $category = get_the_category(); if ( $category ) { /* translators: %s is Category name */ echo '' . esc_html( $category[0]->name ) . ' '; } } endif; if ( ! function_exists( 'bigbang_get_author' ) ) : /** * Returns the author meta data outside the loop. * * @since bigbang 1.0 */ function bigbang_get_author( $info ) { global $post; $author_id = $post->post_author; $author = get_the_author_meta( $info, $author_id ); return $author; } endif; if ( ! function_exists( 'bigbang_author_box' ) ) : /** * Display author box below the posts. * * @since bigbang 1.0 */ function bigbang_author_box() { ?>

'', 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'nextpagelink' => esc_html__( 'Next page', 'bigbang' ), 'previouspagelink' => esc_html__( 'Previous page', 'bigbang' ), 'pagelink' => '%', 'echo' => 1, ); $r = wp_parse_args( $args, $defaults ); $r = apply_filters( 'wp_link_pages_args', $r ); global $page, $numpages, $multipage, $more, $pagenow; $output = ''; if ( $multipage ) { if ( 'number' == $r['next_or_number'] ) { $output .= $r['before']; for ( $i = 1; $i < ( $numpages + 1 ); $i = $i + 1 ) { $j = str_replace( '%', $i, $r['pagelink'] ); $output .= ' '; $output .= $r['link_before']; if ( $i != $page || ( ( ! $more ) && ( $page == 1 ) ) ) { $output .= _wp_link_page( $i ); } else { $output .= ''; } $output .= $j; if ( $i != $page || ( ( ! $more ) && ( $page == 1 ) ) ) { $output .= ''; } else { $output .= ''; } $output .= $r['link_after']; } $output .= $r['after']; } else { if ( $more ) { $output .= $r['before']; $i = $page - 1; if ( $i && $more ) { $output .= _wp_link_page( $i ); $output .= $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . ''; } $i = $page + 1; if ( $i <= $numpages && $more ) { $output .= _wp_link_page( $i ); $output .= $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . ''; } $output .= $r['after']; } }// End if(). }// End if(). if ( $r['echo'] ) { echo wp_kses( $output, array( 'div' => array( 'class' => array(), 'id' => array(), ), 'ul' => array( 'class' => array(), ), 'a' => array( 'href' => array(), ), 'li' => array(), 'span' => array( 'class' => array(), ), ) ); } return $output; } endif; if ( ! function_exists( 'bigbang_comments_list' ) ) : /** * Custom list of comments for the theme. * * @since bigbang 1.0 */ function bigbang_comments_list( $comment, $args, $depth ) { ?>
id="comment-">

'; } $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $args = array( 'class_form' => 'form media-body', 'class_submit' => 'btn btn-primary pull-right', 'title_reply_before' => '

', 'title_reply_after' => '

' . $current_user . '
', 'must_log_in' => '

' . sprintf( wp_kses( /* translators: %s is Link to login */ __( 'You must be logged in to post a comment.', 'bigbang' ), array( 'a' => array( 'href' => array(), ), ) ), esc_url( wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ) ) ) . '

', 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' => '
', 'email' => '
', 'url' => '
', ) ), 'comment_field' => '
', ); return $args; } endif; if ( ! function_exists( 'bigbang_comments_pagination' ) ) : /** * Display a custom number page navigation for comments. * * @since bigbang 1.0 */ function bigbang_comments_pagination() { $pages = paginate_comments_links( array( 'echo' => false, 'type' => 'array', ) ); if ( is_array( $pages ) ) { echo '
'; } } endif; if ( ! function_exists( 'bigbang_related_posts' ) ) : /** * Related posts for single view. * * @since bigbang 1.0 */ function bigbang_related_posts() { global $post; $cats = wp_get_object_terms( $post->ID, 'category', array( 'fields' => 'ids', ) ); $args = array( 'posts_per_page' => 3, 'cat' => $cats, 'orderby' => 'date', 'ignore_sticky_posts' => true, 'post__not_in' => array( $post->ID ), ); $allowed_html = array( 'br' => array(), 'em' => array(), 'strong' => array(), 'i' => array( 'class' => array(), ), 'span' => array(), ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) : ?> array( 'class' => array(), ), 'a' => array( 'href' => array(), 'target' => array(), 'title' => array(), 'rel' => array(), 'class' => array(), 'data-original-title' => array(), ), 'i' => array( 'class' => array(), ), ); if ( (bool) $enabled_socials === true ) { $social_links = '
'; } echo apply_filters( 'bigbang_filter_blog_social_icons', wp_kses( $social_links, $allowed_tags ) ); } endif; if ( ! function_exists( 'bigbang_get_image_sizes' ) ) : /** * Output image sizes for attachment single page. * * @since bigbang 1.0 */ function bigbang_get_image_sizes() { /* If not viewing an image attachment page, return. */ if ( ! wp_attachment_is_image( get_the_ID() ) ) { return; } /* Set up an empty array for the links. */ $links = array(); /* Get the intermediate image sizes and add the full size to the array. */ $sizes = get_intermediate_image_sizes(); $sizes[] = 'full'; /* Loop through each of the image sizes. */ foreach ( $sizes as $size ) { /* Get the image source, width, height, and whether it's intermediate. */ $image = wp_get_attachment_image_src( get_the_ID(), $size ); /* Add the link to the array if there's an image and if $is_intermediate (4th array value) is true or full size. */ if ( ! empty( $image ) && ( true == $image[3] || 'full' == $size ) ) { $links[] = '' . $image[1] . ' × ' . $image[2] . ''; } } /* Join the links in a string and return. */ return join( ' | ', $links ); } endif; if ( ! function_exists( 'bigbang_contact_get_old_content' ) ) : /** * bigbang Contact Old Defaults */ function bigbang_contact_get_old_content( $theme_mod ) { $contact_section_default_old = get_theme_mod( $theme_mod ); $output = ''; if ( ! empty( $contact_section_default_old ) ) { $contact_section_default_old_content = json_decode( $contact_section_default_old ); if ( ! empty( $contact_section_default_old_content ) ) { foreach ( $contact_section_default_old_content as $contact_item ) { if ( ! empty( $contact_item ) ) { $output .= '
' . "\n"; if ( ! empty( $contact_item->icon_value ) ) { $output .= '
' . "\n"; } $output .= '
' . "\n"; if ( ! empty( $contact_item->title ) ) { $output .= '

' . wp_kses_post( $contact_item->title ) . '

' . "\n"; } if ( ! empty( $contact_item->text ) ) { $output .= '

' . wp_kses_post( $contact_item->text ) . '

' . "\n"; } $output .= '
'; } } } } return $output; } endif; if ( ! function_exists( 'bigbang_the_footer_content' ) ) : /** * Function to display footer content. * * @since 1.1.24 * @access public */ function bigbang_the_footer_content() { /** * Array holding all registered footer widgets areas */ $bigbang_footer_widgets_ids = array( 'footer-one-widgets', 'footer-two-widgets', 'footer-three-widgets', 'footer-four-widgets', ); $bigbang_footer_class = 'col-md-4'; $footer_has_widgets = false; $bigbang_nr_footer_widgets = get_theme_mod( 'bigbang_nr_footer_widgets', '3' ); /** * Enabling alternative footer style */ $footer_style = get_theme_mod( 'bigbang_alternative_footer_style', 'black_footer' ); switch ( $footer_style ) { case 'black_footer': $footer_class = 'footer-black'; break; case 'white_footer': $footer_class = ''; break; default: $footer_class = 'footer-black'; } /** * Get the widgets areas ids and class corresponding to the number selected by the user */ if ( ! empty( $bigbang_nr_footer_widgets ) ) { $bigbang_footer_widgets_ids = array_slice( $bigbang_footer_widgets_ids, 0, $bigbang_nr_footer_widgets ); switch ( $bigbang_nr_footer_widgets ) { case 1: $bigbang_footer_class = 'col-md-12'; break; case 2: $bigbang_footer_class = 'col-md-6'; break; case 3: $bigbang_footer_class = 'col-md-4'; break; case 4: $bigbang_footer_class = 'col-md-3'; break; } } /** * Check if the selected footer widgets areas are not empty */ if ( ! empty( $bigbang_footer_widgets_ids ) ) { foreach ( $bigbang_footer_widgets_ids as $bigbang_footer_widget_item ) { $footer_has_widgets = is_active_sidebar( $bigbang_footer_widget_item ); if ( $footer_has_widgets ) { break; } } } bigbang_before_footer_trigger(); ?>
'top-bar-menu', 'depth' => 1, 'container' => 'div', 'container_id' => 'top-bar-navigation', 'menu_class' => 'nav top-bar-nav', 'fallback_cb' => 'bigbang_bootstrap_navwalker::fallback', 'walker' => new bigbang_bootstrap_navwalker(), ) ); ?>
'.classes_to_add', * 'sidebar-right' => '.classes_to_add'', * 'sidebar-left' => '.classes_to_add', * 'is_shop' => false * ) * * @param string $layout Control on page layout. * @param string $sidebar_name Sidebar id. * @param array $args Arguments. * * @return string */ function bigbang_get_content_classes( $layout, $sidebar_name, $args ) { if ( ( bigbang_woocommerce_check() && ( is_product() || is_cart() || is_checkout() || is_account_page() ) ) || is_singular( 'elementor_library' ) ) { return 'col-md-12'; } $class_to_add = ! empty( $args['full-width'] ) ? $args['full-width'] : 'col-md-12'; $is_shop = ! empty( $args['is_shop'] ) ? $args['is_shop'] : false; if ( is_active_sidebar( $sidebar_name ) && ! empty( $layout ) || is_customize_preview() ) { switch ( $layout ) { case 'sidebar-right': $class_to_add = $args['sidebar-right']; if ( $is_shop && ! is_product() ) { add_filter( 'loop_shop_columns', 'bigbang_shop_loop_columns' ); } break; case 'sidebar-left': $class_to_add = $args['sidebar-left']; if ( $is_shop && ! is_product() ) { add_filter( 'loop_shop_columns', 'bigbang_shop_loop_columns' ); } break; } } return $class_to_add; } endif; if ( ! function_exists( 'bigbang_get_sidebar' ) ) : /** * Function to display the proper sidebar depending on the page ( WooCommerce sidebar or normal sidebar ) */ function bigbang_get_sidebar() { if ( bigbang_woocommerce_check() && ( is_cart() || is_checkout() || is_account_page() ) ) { return; } if ( bigbang_woocommerce_check() && is_shop() ) { get_sidebar( 'woocommerce' ); } else { get_sidebar(); } } endif; if ( ! function_exists( 'bigbang_hidden_sidebars' ) ) : /** * Fix for sections with widgets not appearing anymore after the hide button is selected for each section. * * @since 1.1.41 */ function bigbang_hidden_sidebars() { ?>
$element ) { // Name field if ( $element['id'] === 'pirate-forms-contact-name' ) { $elements[ $key ]['wrap']['class'] = 'col-xs-12 col-sm-6 contact_name_wrap pirate_forms_three_inputs form_field_wrap'; $elements[ $key ]['label']['html'] = $elements[ $key ]['placeholder']; $elements[ $key ]['label']['class'] = 'control-label'; $elements[ $key ]['placeholder'] = ''; } // E-mail field if ( $element['id'] === 'pirate-forms-contact-email' ) { $elements[ $key ]['wrap']['class'] = 'col-xs-12 col-sm-6 contact_email_wrap pirate_forms_three_inputs form_field_wrap'; $elements[ $key ]['label']['html'] = $elements[ $key ]['placeholder']; $elements[ $key ]['label']['class'] = 'control-label'; $elements[ $key ]['placeholder'] = ''; } // Subject field if ( $element['id'] === 'pirate-forms-contact-subject' ) { $elements[ $key ]['wrap']['class'] = 'col-xs-12 contact_subject_wrap pirate_forms_three_inputs form_field_wrap'; $elements[ $key ]['label']['html'] = $elements[ $key ]['placeholder']; $elements[ $key ]['label']['class'] = 'control-label'; $elements[ $key ]['placeholder'] = ''; } // Message field if ( $element['id'] === 'pirate-forms-contact-message' ) { $elements[ $key ]['wrap']['class'] = 'col-xs-12 form_field_wrap contact_message_wrap'; $elements[ $key ]['label']['html'] = $elements[ $key ]['placeholder']; $elements[ $key ]['label']['class'] = 'control-label'; $elements[ $key ]['placeholder'] = ''; } } return $elements; }, 20 ); if ( ! function_exists( 'bigbang_scroll_to_top' ) ) : /** * Display scroll to top button. * * @since 1.1.54 */ function bigbang_scroll_to_top() { $bigbang_enable_scroll_to_top = get_theme_mod( 'bigbang_enable_scroll_to_top' ); if ( empty( $bigbang_enable_scroll_to_top ) ) { return; } ?>

%1$s', esc_html( bigbang_get_author( 'display_name' ) ), esc_url( get_author_posts_url( bigbang_get_author( 'ID' ) ) ) ), /* translators: %s is Date */ sprintf( '', esc_html( get_the_time( get_option( 'date_format' ) ) ), esc_html( get_the_date( DATE_W3C ) ) ) ) ); if ( $layout === 'default' ) { ?>

'; echo apply_filters( 'bigbang_header_wrapper_background_filter', $header_filter_div ); } endif; /** * Display pagination on single page and single portfolio. */ function bigbang_single_pagination() { ?>
'
', 'link_before' => '
  • ', 'link_after' => '
  • ', ) ); ?>
    'post', 'posts_per_page' => ! empty( $number_of_posts ) ? absint( $number_of_posts ) : 3, 'order' => 'DESC', 'ignore_sticky_posts' => true, 'category__in' => $bigbang_featured_posts_category, ) ); /** * Exit if there aren't any posts to display. */ if ( ! $post->have_posts() ) { return; } /** * Index of the current post that is showed in loop. */ $item_index = 0; /** * The total number of posts. */ $category = get_category( $bigbang_featured_posts_category[0] ); $total_posts = $category->category_count; echo ''; return $posts_to_skip; } } /** * Based on the post index, decide if the post should display full width or just 50% of the page. * * @param int $index Post index. * @param int $total_posts Number of posts in category. * * @return string */ function bigbang_get_blog_featured_posts_card_class( $index, $total_posts ) { $default_blog_layout = bigbang_sidebar_on_single_post_get_default(); $bigbang_blog_sidebar_layout = get_theme_mod( 'bigbang_blog_sidebar_layout', $default_blog_layout ); if ( $bigbang_blog_sidebar_layout === 'full-width' || ( ! is_active_sidebar( 'sidebar-1' ) && ! is_customize_preview() ) ) { $md_class = 10; $offset_class = 1; } else { $md_class = 12; $offset_class = 0; } if ( $total_posts > 1 ) { /** * First card should have half of full width card. */ if ( $index % 3 === 1 ) { $md_class = $md_class / 2; } /** * Second card should have half of full width card but not the offset. */ if ( $index % 3 === 2 ) { $md_class = $md_class / 2; $offset_class = 0; } } $class = 'col-md-' . $md_class; if ( $offset_class > 0 ) { $class .= ' col-md-offset-' . $offset_class; } return $class; } if ( ! function_exists( 'bigbang_filter_archive_title' ) ) { /** * Remove "Category:", "Tag:", "Author:" from the archive title. * * @param string $title Archive title. */ function bigbang_filter_archive_title( $title ) { if ( $title === 'Archives' || is_tax( 'post_format' ) ) { return $title; } return preg_replace( '/.*: /', '', $title, 1 ); } } if ( function_exists( 'bigbang_filter_archive_title' ) ) { add_filter( 'get_the_archive_title', 'bigbang_filter_archive_title' ); } /** * Function to move a sidebar section to another panel and then move controls to this sidebar section. * * @param array $settings Necessary settings to move the sidebar. * @param object $wp_customize Customizer object. */ function bigbang_move_customizer_sidebar( $settings, $wp_customize ) { if ( empty( $settings ) ) { return; } if ( empty( $settings['section_id'] ) ) { return; } $sidebar_section = $wp_customize->get_section( $settings['section_id'] ); if ( ! empty( $sidebar_section ) ) { if ( ! empty( $settings['panel'] ) ) { $sidebar_section->panel = $settings['panel']; } if ( ! empty( $settings['priority'] ) ) { $sidebar_section->priority = $settings['priority']; } if ( ! empty( $settings['controls_to_move'] ) ) { foreach ( $settings['controls_to_move'] as $control_id ) { $control = $wp_customize->get_control( $control_id ); if ( ! empty( $control ) ) { $control->section = $settings['section_id']; $control->priority = -3; } } } } } /** * Determine the classes that should be on widgets and slider content. * * @param string $bigbang_slider_alignment Slider alignment. * * @return array */ function bigbang_get_slider_elements_class( $bigbang_slider_alignment ) { $result_array = array( 'slide' => ' big-title-slider-content text-' . $bigbang_slider_alignment, 'widget' => ' col-md-5 ', ); switch ( $bigbang_slider_alignment ) { case 'left': $result_array['slide'] .= ' col-md-7 '; $result_array['widget'] .= ' bigbang-slider-alignment-left '; break; case 'center': $result_array['slide'] .= ' col-sm-8 col-sm-offset-2 '; break; case 'right': $result_array['slide'] .= ' col-md-7 margin-left-auto '; $result_array['widget'] .= ' bigbang-slider-alignment-right '; break; } return $result_array; }