implode( '&family=', $business_classified_ads_font_families ), 'display' => 'swap', ), 'https://fonts.googleapis.com/css2' ); return esc_url_raw($business_classified_ads_fonts_url); } endif; if ( ! function_exists( 'business_classified_ads_sub_menu_toggle_button' ) ) : function business_classified_ads_sub_menu_toggle_button( $business_classified_ads_args, $business_classified_ads_item, $depth ) { // Add sub menu toggles to the main menu with toggles if ( $business_classified_ads_args->theme_location == 'business-classified-ads-primary-menu' && isset( $business_classified_ads_args->show_toggles ) ) { // Wrap the menu item link contents in a div, used for positioning $business_classified_ads_args->before = '
'; // Add sub menu icons to the main menu without toggles (the fallback menu) }elseif( $business_classified_ads_args->theme_location == 'business-classified-ads-primary-menu' ) { if ( in_array( 'menu-item-has-children', $business_classified_ads_item->classes ) ) { $business_classified_ads_args->before = ''; } else { $business_classified_ads_args->before = ''; $business_classified_ads_args->after = ''; } } return $business_classified_ads_args; } endif; add_filter( 'nav_menu_item_args', 'business_classified_ads_sub_menu_toggle_button', 10, 3 ); if ( ! function_exists( 'business_classified_ads_the_theme_svg' ) ): function business_classified_ads_the_theme_svg( $business_classified_ads_svg_name, $business_classified_ads_return = false ) { if( $business_classified_ads_return ){ return business_classified_ads_get_theme_svg( $business_classified_ads_svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in business_classified_ads_get_theme_svg();. }else{ echo business_classified_ads_get_theme_svg( $business_classified_ads_svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in business_classified_ads_get_theme_svg();. } } endif; if ( ! function_exists( 'business_classified_ads_get_theme_svg' ) ): function business_classified_ads_get_theme_svg( $business_classified_ads_svg_name ) { // Make sure that only our allowed tags and attributes are included. $business_classified_ads_svg = wp_kses( Business_Classified_Ads_SVG_Icons::get_svg( $business_classified_ads_svg_name ), array( 'svg' => array( 'class' => true, 'xmlns' => true, 'width' => true, 'height' => true, 'viewbox' => true, 'aria-hidden' => true, 'role' => true, 'focusable' => true, ), 'path' => array( 'fill' => true, 'fill-rule' => true, 'd' => true, 'transform' => true, ), 'polygon' => array( 'fill' => true, 'fill-rule' => true, 'points' => true, 'transform' => true, 'focusable' => true, ), 'polyline' => array( 'fill' => true, 'points' => true, ), 'line' => array( 'fill' => true, 'x1' => true, 'x2' => true, 'y1' => true, 'y2' => true, ), ) ); if ( ! $business_classified_ads_svg ) { return false; } return $business_classified_ads_svg; } endif; if( !function_exists( 'business_classified_ads_post_category_list' ) ) : // Post Category List. function business_classified_ads_post_category_list( $business_classified_ads_select_cat = true ){ $business_classified_ads_post_cat_lists = get_categories( array( 'hide_empty' => '0', 'exclude' => '1', ) ); $business_classified_ads_post_cat_cat_array = array(); if( $business_classified_ads_select_cat ){ $business_classified_ads_post_cat_cat_array[''] = esc_html__( '-- Select Category --','business-classified-ads' ); } foreach ( $business_classified_ads_post_cat_lists as $business_classified_ads_post_cat_list ) { $business_classified_ads_post_cat_cat_array[$business_classified_ads_post_cat_list->slug] = $business_classified_ads_post_cat_list->name; } return $business_classified_ads_post_cat_cat_array; } endif; if( !function_exists('business_classified_ads_single_post_navigation') ): function business_classified_ads_single_post_navigation(){ $business_classified_ads_default = business_classified_ads_get_default_theme_options(); $business_classified_ads_twp_navigation_type = esc_attr( get_post_meta( get_the_ID(), 'twp_disable_ajax_load_next_post', true ) ); $business_classified_ads_current_id = ''; $article_wrap_class = ''; global $post; $business_classified_ads_current_id = $post->ID; if( $business_classified_ads_twp_navigation_type == '' || $business_classified_ads_twp_navigation_type == 'global-layout' ){ $business_classified_ads_twp_navigation_type = get_theme_mod('twp_navigation_type', $business_classified_ads_default['twp_navigation_type']); } if( $business_classified_ads_twp_navigation_type != 'no-navigation' && 'post' === get_post_type() ){ if( $business_classified_ads_twp_navigation_type == 'theme-normal-navigation' ){ ?> ID ) ){ $business_classified_ads_next_post_id = $business_classified_ads_next_post->ID; echo ''; } } } } endif; add_action( 'business_classified_ads_navigation_action','business_classified_ads_single_post_navigation',30 ); if( !function_exists('business_classified_ads_content_offcanvas') ): // Offcanvas Contents function business_classified_ads_content_offcanvas(){ ?> 'post', 'posts_per_page' => 4, 'post__not_in' => get_option( 'sticky_posts' ), 'category_name' => esc_html( $business_classified_ads_header_banner_cat ), ) ); // Check if the query has posts if ( ! $banner_query->have_posts() ) { error_log('No posts found for the banner query.'); return ''; // Exit early if no posts } ob_start(); // Start output buffering ?>