Untitled Snippet

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); if (strpos($url,’product_search=’) !== false) { $attributes[‘index’] = “noindex”; }; return $attributes; }Continue reading

Allow ico Files Upload

/*——————————————— TYPE MIME ICO par HP MC&C ———————————————-*/ function allow_ico_mime_types( $mimes ){ $mimes[‘ico’] = ‘image/x-icon’; return $mimes; } add_filter( ‘upload_mimes’, ‘allow_ico_mime_types’ );Continue reading

Leave Tasty recipe ratings with WP-PostRatings

// Disable standard ratings UI add_filter( ‘tasty_recipes_enable_ratings’, ‘__return_false’ ); /**  * Filter template variables to render WP-PostRatings UI  * within the recipe card.  *  * @param array $template_vars Variables to be passed to the template.  * @param object $recipe  …Continue reading

Untitled Snippet

jQuery(“.elementor-search-form__submit”).click(function(){ var search_keyword = jQuery(“input[class=’elementor-search-form__input’]”).attr(‘value’); } // Make the request to the ChatGPT 3.5 Turbo model (replace with your own implementation) jQuery.ajax({ url: ’80nq7y2YnI1hikzzB52KT3BlbkFJ916qLHptkxZcRoUShGGA’, type: ‘POST’, data: { search_query: search_keyword }, success: function(response) { // Handle the response from the…Continue reading

TOC before first heading

/** * TOC After First Heading */ function cwp_toc_after_first_heading( $output, $block ) { if ( ‘core/heading’ !== $block[‘blockName’] ) { return $output; } global $wp_query; if ( ! $wp_query->in_the_loop ) { return $output; } // Only run once. remove_filter( ‘render_block’,…Continue reading

CWP – MailChimp RSS email ID

/** * RSS feed, add MailChimp email query string */ function cwp_rss_mailchimp_email( $url ) { return add_query_arg( ‘adt_ei’, ‘*|EMAIL|*’, $url ); } add_filter( ‘the_permalink_rss’, ‘cwp_rss_mailchimp_email’ );Continue reading

CWP – ConvertKit RSS email ID

/** * RSS feed, add ConvertKit email query string (Part 1) */ function cwp_rss_convertkit_email( $url ) { return add_query_arg( ‘adt_ei’, ‘subscriber.email_address’, $url ); } add_filter( ‘the_permalink_rss’, ‘cwp_rss_convertkit_email’ ); /** * Modify ConvertKit email string (Part 2) * esc_url will remove…Continue reading