Jagdish Sarma | Reputations Jagdish Sarma580QuestionsAnswersReputationsAsked a question Add CSS to the TinyMCE editor in the WordPress admin area[apcode language="php"] function add_custom_editor_styles() { add_editor_style('css/tinymce-styles.css'); } add_action('admin_enqueue_scripts', 'add_custom_editor_styles');...November 7, 20232Asked a question Wordpress admin fix media image not preview issue[apcode language="php"] add_action('admin_footer', 'fix_media_script_footer', 100); function fix_media_script_footer() {?> <script> jQuery(document).on('click',...November 7, 20232Asked a question Remove nofollow link from comment reply link[apcode language="php"] function remove_nofollow($link, $args, $comment, $post){ return str_replace("rel='nofollow'", "", $link); } add_filter('comment_reply_link',...October 17, 20232Asked a question Wordpress Select Parent category based on Child Category Select[apcode language="jscript"] jQuery(document).on('change', '.categorychecklist ul.children input[name="post_category[]"]', function () { get_par = jQuery(this).parents('ul.children');...September 21, 20232Asked a question Woocommerce hide free shipping if non free shipping product added[apcode language="php"] add_filter( 'woocommerce_package_rates', 'bbloomer_hide_free_shipping_for_shipping_class', 9999, 2 ); function bbloomer_hide_free_shipping_for_shipping_class(...September 12, 20232Asked a question Woocommerce add alert if free shipping items and non-free shipping items added in cart[apcode language="php"] add_action( 'woocommerce_check_cart_items', 'custom_prevent_free_and_non_free_shipping_products' ); function custom_prevent_free_and_non_free_shipping_products()...September 12, 20232Asked a question Woocommerce Add Custom Shipping fee based on Shipping Class[apcode language="php"] function custom_shipping_class_fee($rates, $package) { // Define the shipping class that triggers the additional fee. $target_shipping_class = 'engineered-flooring';...September 12, 20232Asked a question JavaScript code to download HTML table column data as CSV[apcode language="jscript"] function downloadCSV(tableId, filename) { // Get the table element. var table = document.getElementById(tableId); // Create an array to store the data from each...August 29, 20232Asked a question WordPress Admin Ajax Response Trim or Remove Extra Space[apcode language="php"] add_action('admin_footer', 'fix_ajax_script_footer', 100); function fix_ajax_script_footer() { global $pagenow; if ( is_admin() && $pagenow == 'edit-tags.php'...July 14, 20232Asked a question Wordpress divi hide project post type[apcode language="php"] add_filter( 'et_project_posttype_args', 'c2_et_project_posttype_args', 10, 1 ); function c2_et_project_posttype_args( $args ) { return array_merge( $args,...June 8, 20232Asked a question Wordpress excerpt replace read more with dot[apcode language="php"] function c2_excerpt_more($more) { return '...'; } add_filter('excerpt_more', 'c2_excerpt_more'); [/apcode]June 8, 20232Asked a question Wordpress custom excerpt length[apcode language="php"] function custom_excerpt_length( $length ) { return 15; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); [/apcode]June 8, 20232Asked a question Divi Video Background preloader style[apcode language="css"] .et_pb_preload:before { top: 50%; left: 50%; } [/apcode]June 8, 20232Asked a question Reorder The Divi Blog Image, Title, Meta, Excerpt, and Button[apcode language="css"] /*make the parts of the blog post flexible*/ .et_pb_post { display: flex; flex-direction: column; } /*blog post featured image*/ .et_pb_post .et_pb_image_container,...May 30, 20232Asked a question WordPress SVG Upload support[apcode language="php"] add_filter( 'upload_mimes', 'c2code_43862_svg_upload' ); function c2code_43862_svg_upload( $existing_mimes = array() ) { $existing_mimes['svg']...May 25, 20232Asked a question WordPress remove site health errors[apcode language="php"] add_filter('site_status_tests', function ($tests) { unset($tests['direct']['php_sessions']); unset($tests['direct']['rest_availability']);...May 23, 20232Asked a question Woocommerce hide stripe for india[apcode language="php"] add_filter('woocommerce_available_payment_gateways', 'hide_stripe_for_india'); function hide_stripe_for_india($available_gateways) { if (is_admin())...May 15, 20232Asked a question WordPress check if any post exist with a meta valueFirst create ajax function to trigger when input field filled [apcode language="jscript"] jQuery(document).on('change, keyup', '.cert_number input', function(e) { get_key = jQuery(this).val();...April 25, 20232Asked a question Wordpress count author post using id[apcode language="php"] $post = $wp_query->get_queried_object(); $author_id = $post->post_author; $post_count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '"...April 13, 20232Asked a question PHP remove last dash[apcode language="php"] $str = "https://codex.wordpress.org/"; echo $str . "<br>"; echo rtrim($str,"/"); [/apcode]April 12, 20232Load More