function wpb_change_search_url() { if ( is_search() && ! empty( $_GET[‘s’] ) ) { wp_redirect( home_url( “/search/” ) . urlencode( get_query_var( ‘s’ ) ) ); exit(); } } add_action( ‘template_redirect’, ‘wpb_change_search_url’ );Continue reading
add_filter( ‘aioseo_toc_hash_prefix’, function( $prefix ) { return ”; } );Continue reading
add_filter( ‘aioseo_toc_hash_prefix’, function( $prefix ) { return ‘mysite-‘; } );Continue reading
function preload_first_content_image() { if (is_single()) { $post = get_post(); if ($post) { // Get post content $content = $post->post_content; // Find first image in the content preg_match_all(‘//i’, $content, $matches); if (!empty($matches[1])) { $first_image = $matches[1][0]; echo ‘‘; } } }…Continue reading
function get_input_button( $type, $button ) { $link_set = false; $class_set = false; $html = ‘Continue reading
/** * Removes the ‘woocommerce_package_rates’ filter added by the Caddy plugin. * * Removes the filter that hides other WooCommerce shipping rates * when free shipping is available, allowing all rates to show. * * @author Mike Valera * @plugin…Continue reading
add_filter(‘aioseo_schema_output’, ‘aioseo_remove_health_and_beauty_business_schema’); function aioseo_remove_health_and_beauty_business_schema($graphs) { foreach ($graphs as $index => $value) { if (isset($value[‘@type’]) && $value[‘@type’] === ‘HealthAndBeautyBusiness’) { unset($graphs[$index]); } } return $graphs; }Continue reading
/** * Add autocomplete setting to form fields. */ add_action( ‘elementor/element/form/section_form_fields/before_section_end’, function( \Elementor\Widget_Base $widget ) { $elementor = \ElementorPro\Plugin::elementor(); $control_data = $elementor->controls_manager->get_control_from_stack( $widget->get_unique_name(), ‘form_fields’ ); if( is_wp_error( $control_data ) ) { return; } $control_data[‘fields’] = $control_data[‘fields’] + [ ‘namespace_autocomplete’ =>…Continue reading
function ele_disable_page_title( $return ) { return false; } add_filter( ‘hello_elementor_page_title’, ‘ele_disable_page_title’ );Continue reading
add_filter( ‘woocommerce_coupon_message’, ‘modify_woocommerce_coupon_message’, 10, 3 ); function modify_woocommerce_coupon_message( $msg, $msg_code, $coupon ) { if( $msg === __( ‘Coupon code applied successfully.’, ‘woocommerce’ ) ) { $msg = sprintf( __( “You are getting $%s discounts.”, “woocommerce” ), ‘‘ . $coupon->get_amount() .…Continue reading