' : ''; return $search_item; } /** * Add search menu item to main menu. * * @param string $items The menu items. * @param object $args The arguments. * * @return string The updated menu items. */ function wpbf_search_menu_icon( $items, $args ) { // Stop here, if we have an off canvas menu. if ( wpbf_is_off_canvas_menu() ) { return $items; } // Only add the search menu item to the main navigation and if it's enabled. if ( 'main_menu' === $args->theme_location && get_theme_mod( 'menu_search_icon' ) ) { $items .= wpbf_search_menu_item(); } return $items; } add_filter( 'wp_nav_menu_items', 'wpbf_search_menu_icon', 20, 2 ); /** * Add search menu item to mobile menu. */ function wpbf_search_menu_icon_mobile() { // Stop here if search menu item is turned off. if ( ! get_theme_mod( 'mobile_menu_search_icon' ) ) { return; } echo wpbf_search_menu_item( $is_navigation = false, $is_mobile = true ); } add_action( 'wpbf_before_mobile_toggle', 'wpbf_search_menu_icon_mobile', 20 ); /** * Custom breadcrumbs separator. * * @param string $separator The separator. * * @return string The updated separator. */ function wpbf_breadcrumbs_custom_separator( $separator ) { $custom_separator = get_theme_mod( 'breadcrumbs_separator' ); if ( $custom_separator ) { return $custom_separator; } return $separator; } add_filter( 'wpbf_breadcrumbs_separator', 'wpbf_breadcrumbs_custom_separator' ); /** * Next post link. * * @param string $next The next post link. * * @return string The updated post link. */ function wpbf_next_post_link( $next ) { if ( 'default' !== get_theme_mod( 'single_post_nav' ) ) { return $next; } return '%title →'; } add_filter( 'wpbf_next_post_link', 'wpbf_next_post_link' ); /** * Previous post link. * * @param string $next The previous post link. * * @return string The updated post link. */ function wpbf_previous_post_link( $prev ) { if ( 'default' !== get_theme_mod( 'single_post_nav' ) ) { return $prev; } return '← %title'; } add_filter( 'wpbf_previous_post_link', 'wpbf_previous_post_link' ); /** * Categories title. * * @param string $title The categories title. * * @return string The updated categories title. */ function wpbf_categories_title( $title ) { $cat_title = get_theme_mod( 'blog_categories_title' ); if ( $cat_title ) { return $cat_title; } return $title; } add_filter( 'wpbf_categories_title', 'wpbf_categories_title' ); /** * Read more text. * * @param string $text The read more text. * * @return string The updated read more text. */ function wpbf_read_more_text( $text ) { $read_more_text = get_theme_mod( 'blog_read_more_text' ); if ( $read_more_text ) { return $read_more_text; } return $text; } add_filter( 'wpbf_read_more_text', 'wpbf_read_more_text' ); /** * Article meta separatpr. * * @param string $separator The separator. * * @return string The updated separator. */ function wpbf_article_meta_separator( $separator ) { $blog_meta_separator = get_theme_mod( 'blog_meta_separator' ); if ( $blog_meta_separator ) { return ' ' . $blog_meta_separator . ' '; } return $separator; } add_filter( 'wpbf_article_meta_separator', 'wpbf_article_meta_separator' ); /** * Custom mobile logo. * * @param string $logo_url The logo url. * * @return string The updated logo url. */ function wpbf_mobile_logo( $logo_url ) { $custom_logo_url = get_theme_mod( 'menu_mobile_logo' ); if ( $custom_logo_url ) { return $custom_logo_url; } return $logo_url; } add_filter( 'wpbf_logo_mobile', 'wpbf_mobile_logo' );