', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'paddle_pingback_header' ); /** * Add a dropdown icon to top-level menu items. * * @param string $output Nav menu item start element. * @param object $item Nav menu item. * @param int $depth Depth. * @param object $args Nav menu args. * @return string Nav menu item start element. * Add a dropdown icon to top-level menu items */ function paddle_nav_add_dropdown_icons( $output, $item, $depth, $args ) { // Only add class to 'top level' items on the 'primary' menu. if ( ! isset( $args->theme_location ) || 'primary' !== $args->theme_location ) { return $output; } if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { ob_start(); ?> element of the menu item targeted. $output .= $custom_sub_menu_html; } return $output; } add_filter( 'walker_nav_menu_start_el', 'paddle_nav_add_dropdown_icons', 10, 4 ); /** * Generate custom search form * * @param string $form Form HTML. * @return string Modified form HTML. */ function paddle_search_form( $form ) { $form = ''; return $form; } add_filter( 'get_search_form', 'paddle_search_form' ); /** * @usage: For Minimizing dynamic CSS */ function paddle_minimize_css( $css ) { $css = preg_replace( '/\/\*((?!\*\/).)*\*\//', '', $css ); $css = preg_replace( '/\s{2,}/', ' ', $css ); $css = preg_replace( '/\s*([:;{}])\s*/', '$1', $css ); $css = preg_replace( '/;}/', '}', $css ); return $css; } /** * paddle_layout_container * * @param mixed $layout * @return void */ function paddle_layout_container( $layout = '' ) { $paddle_sidebar_layout_option = absint( get_theme_mod( 'paddle_page_layout_sidebar', 1 ) ); $col_8 = 'col-lg-8'; $col_4 = 'col-lg-4'; if ( class_exists( 'woocommerce' ) ) { if ( is_woocommerce() ) { $col_8 = 'col-lg-9'; } } if ( class_exists( 'woocommerce' ) ) { if ( is_woocommerce() ) { $col_4 = 'col-lg-3'; } } if ( 'content' === $layout ) : $paddle_container = ( 0 === $paddle_sidebar_layout_option ) ? 'col-lg-12' : ( ( 1 === $paddle_sidebar_layout_option ) ? $col_8 : '' ); else : $paddle_container = ( 0 === $paddle_sidebar_layout_option ) ? 'col-lg-12' : ( ( 1 === $paddle_sidebar_layout_option ) ? $col_4 : '' ); endif; return $paddle_container; } /** * paddle_layout_width * * @return void */ function paddle_layout_width() { $paddle_full_page_width = absint( get_theme_mod( 'paddle_page_layout_width', 1 ) ); $paddle_page_width_option = ( 0 === $paddle_full_page_width ) ? '' : ( ( 1 === $paddle_full_page_width ) ? 'full-width-content' : '' ); return $paddle_page_width_option; } /** * paddle_add_cta_menu * Add extra list item to menu items * * @param mixed $items * @param mixed $args * @return void */ function paddle_add_cta_menu( $items, $args ) { if ( 'primary' === $args->theme_location && 1 === absint( get_theme_mod( 'paddle_header_cta', 0 ) ) ) { $option_url = get_theme_mod( 'paddle_header_cta_url', home_url() ); $option_text = get_theme_mod( 'paddle_header_cta_text', ' CTA TEXT ' ); $url = esc_url( $option_url ); if ( ! empty( $option_url ) && ! empty( $option_text ) ) { $items .= ''; } } return $items; } add_filter( 'wp_nav_menu_items', 'paddle_add_cta_menu', 10, 2 ); if ( ! function_exists( 'paddle_social_menu ' ) ) : /** * paddle_social_menu * Social Menu Navigation * * @return void */ function paddle_social_menu() { if ( has_nav_menu( 'social' ) ) { wp_nav_menu( array( 'theme_location' => 'social', 'container' => 'div', 'container_id' => 'menu-social', 'container_class' => 'menu-social', 'menu_id' => 'menu-social-items', 'menu_class' => 'menu-items', 'depth' => 1, 'link_before' => '', 'link_after' => '', 'fallback_cb' => '', ) ); } } endif; if ( ! function_exists( ' paddle_banner_align ' ) ) { /** * paddle_banner_align * Get banner align option * * @return void */ function paddle_banner_align() { $paddle_banner_align_postion = get_theme_mod( 'banner_align_position', 'left' ); return $paddle_banner_align_postion; } } if ( ! function_exists( 'paddle_banner_opacity' ) ) { /** * paddle_banner_opacity * Get banner image overlay opacity * * @return void */ function paddle_banner_opacity() { $paddle_banner_opacity = get_theme_mod( 'banner_overlay_opacity', 2 ); return $paddle_banner_opacity; } } if ( ! function_exists( 'paddle_search_modal' ) ) { /** * paddle_search_modal * Search Modal * * @return void */ function paddle_search_modal() { ?>