','

' ); } else { $sep = ' » '; if (!is_front_page()) { // Start the breadcrumb with a link to your homepage echo '
'; echo ''; echo esc_html__( 'Home', 'buddyx'); echo '' . $sep; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped // Check if the current page is a category, an archive or a single page. If so show the category or archive name. if ( is_category() || is_single() ){ the_category(' » '); } elseif ( is_archive() || is_single() ){ if ( is_day() ) { printf( esc_html__( '%s', 'buddyx' ), get_the_date() ); } elseif ( is_month() ) { printf( esc_html__( '%s', 'buddyx' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'buddyx' ) ) ); } elseif ( is_year() ) { printf( esc_html__( '%s', 'buddyx' ), get_the_date( _x( 'Y', 'yearly archives date format', 'buddyx' ) ) ); } elseif( is_shop() ) { esc_html_e( 'Shop', 'buddyx' ); }elseif( is_archive('post-type-archive-forum') ) { esc_html_e( 'Forums Archives', 'buddyx' ); } else { esc_html_e( 'Blog Archives', 'buddyx' ); } } // If the current page is a single post, show its title with the separator if (is_single()) { echo $sep; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped the_title(); } // If the current page is a static page, show its title. if (is_page()) { the_title(); } // if you have a static page assigned to be you posts list page. It will find the title of the static page and display it. i.e Home > Blog if (is_home()){ esc_html_e( 'Blog', 'buddyx' ); } echo '
'; } } } } // Site Loader if ( !function_exists( 'buddyx_site_loader' ) ) { function buddyx_site_loader() { $loader = get_theme_mod( 'site_loader', buddyx_defaults( 'site-loader' ) ); if ( $loader == "1" ) { echo '
'; } } } // Site Search and Woo icon if ( !function_exists( 'buddyx_site_menu_icon' ) ) { function buddyx_site_menu_icon () { // menu icons $searchicon = (int) get_theme_mod( 'site_search', buddyx_defaults( 'site-search' ) ); $carticon = (int) get_theme_mod( 'site_cart', buddyx_defaults( 'site-cart' ) ); if( !empty($searchicon) || !empty($carticon) ) : ?> activity->component ); } } /** * Is the current user online * * @param $user_id * * @return bool */ if ( !function_exists( 'buddyx_is_user_online' ) ) { function buddyx_is_user_online( $user_id ) { if( !function_exists( 'bp_get_user_last_activity' ) ) { return; } $last_activity = strtotime( bp_get_user_last_activity( $user_id ) ); if ( empty( $last_activity ) ) { return false; } // the activity timeframe is 5 minutes $activity_timeframe = 5 * MINUTE_IN_SECONDS; return ( time() - $last_activity <= $activity_timeframe ); } } /** * BuddyPress user status * * @param $user_id * */ if ( !function_exists( 'buddyx_user_status' ) ) { function buddyx_user_status( $user_id ) { if( buddyx_is_user_online( $user_id ) ) { echo ''; } } } /** * woocommerce_cart_collaterals */ remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); add_action( 'woocommerce_after_cart_form', 'woocommerce_cross_sell_display', 10 ); /* Ensure cart contents update when products are added to the cart via AJAX */ add_filter( 'woocommerce_add_to_cart_fragments', 'buddyx_header_add_to_cart_fragment' ); if ( !function_exists( 'buddyx_header_add_to_cart_fragment' ) ) { function buddyx_header_add_to_cart_fragment( $fragments ) { $count = WC()->cart->get_cart_contents_count(); ob_start(); ?> bp_displayed_user_id(), 'display' => true ) ); if ( is_array( $achievements ) && !empty( $achievements ) ) { $number_to_show = 5; $thecount = 0; wp_enqueue_script( 'badgeos-achievements' ); wp_enqueue_style( 'badgeos-widget' ); //load widget setting for achievement types to display $set_achievements = ( isset( $instance[ 'set_achievements' ] ) ) ? $instance[ 'set_achievements' ] : ''; //show most recently earned achievement first $achievements = array_reverse( $achievements ); echo ''; } } } } /** * Function Footer Custom Text */ if ( ! function_exists( 'buddyx_footer_custom_text' ) ) { /** * Function Footer Custom Text * * @since 1.0.14 * @param string $option Custom text option name. * @return mixed Markup of custom text option. */ function buddyx_footer_custom_text() { $copyright = esc_html( get_theme_mod( 'site_copyright_text' ) ); $output = $copyright; if ( '' != $output ) { $output = str_replace( '[current_year]', date_i18n( 'Y' ), $output ); $output = str_replace( '[site_title]', '' . esc_html( get_bloginfo( 'name' ) ) . '', $output ); $theme_author = apply_filters( 'buddyx_theme_author', array( 'theme_name' => __( 'BuddyX WordPress Theme', 'buddyx' ), 'theme_author_url' => esc_url( 'https://wbcomdesigns.com/downloads/buddyx-theme/' ), ) ); $output = str_replace( '[theme_author]', '' . esc_html( $theme_author['theme_name'] ) . '', $output ); } return apply_filters( 'buddyx_footer_copyright_text', $output, $copyright ); } } /** * Categorized Blog * Find out if blog has more than one category. */ if ( ! function_exists( 'buddyx_categorized_blog' ) ) { function buddyx_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'buddyx_category_count' ) ) ) { $all_the_cool_cats = get_categories( array( 'hide_empty' => 1 ) ); $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'buddyx_category_count', $all_the_cool_cats ); } if ( 1 !== (int) $all_the_cool_cats ) { return true; } else { return false; } } } /** * Blog Post Meta */ if ( ! function_exists( 'buddyx_posted_on' ) ) { function buddyx_posted_on() { global $post; if ( is_sticky() && is_home() && ! is_paged() ) { echo '' . esc_html__( 'Sticky', 'buddyx' ) . ''; } if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && buddyx_categorized_blog() ) { echo '' . get_the_category_list(', ') . ''; } if ( ! is_search() ) { if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( esc_html__( 'Leave a comment', 'buddyx' ), esc_html__( '1 Comment', 'buddyx' ), esc_html__( '% Comments', 'buddyx' ) ); echo ''; } } edit_post_link( esc_html__( 'Edit', 'buddyx' ), '', '' ); } }