Skip to main content

Posts

Showing posts from 2020

How to Make Textarea Auto Resize using Javascript?

Make Textarea Auto Resize using Javascript. <!DOCTYPE html> <html> <head>     <title>Textarea Auto Height</title>     <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> </head> <body>    <h1>Textarea Auto Height</h1> <textarea id="resize" style="width: 360px;"></textarea>     <script type="text/javascript">     $('#resize').on('input', function () {          this.style.height = 'auto';             this.style.height = (this.scrollHeight) + 'px';      });  </script>    </body> </html> 

How to send sms in php?

  Send sms in php function sendsms(){ // Account details $apiKey = urlencode('here you will paste your api'); // Message details //$numbers = array(918123456789, 918987654321); $numbers = 1234567890; $sender = urlencode('TXTLCL'); $message = rawurlencode('This is your message');   //$numbers = implode(',', $numbers);   // Prepare data for POST request $data = array('apikey' => $apiKey, 'numbers' => $numbers, "sender" => $sender, "message" => $message);   // Send the POST request with cURL $ch = curl_init('https://api.textlocal.in/send/'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Process your response here echo $response; } sendsms();

How to create stylish table with shorting and pagination in php and jquery?

  Create stylish table with shorting and pagination in php and jquery. <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.2/css/buttons.dataTables.min.css"> <!-- <script src="https://code.jquery.com/jquery-1.12.3.js"></script> <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.flash.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script> <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script> <script src="ht

WooCommerce: Display Product Gallery Vertically (Single Product Page)

   Paste this code in function.php add_filter ( 'woocommerce_product_thumbnails_columns', 'change_product_gallery_columns' );   function change_product_gallery_columns() {      return 1;  } Paste css in style.css /* Make image 75% width to make room to its right */ .single-product div.product .woocommerce-product-gallery .flex-viewport {     width: 75%;     float: right; } /* Make Gallery 25% width and place it beside the image */   .single-product div.product .woocommerce-product-gallery .flex-control-thumbs {     width: 25%;     float: right;     margin: 0; } /* Style each Thumbnail with width and margins */   .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img {     width: 90%;     float: none;     margin: 0 0 10% 10%; }

How to create product slider in wordpress/Woo-commerce?

//Link js file with wordpress function enqueue_files(){ wp_enqueue_script( 'jquery', get_stylesheet_directory_uri() . '/js/jquery.min.js'); } add_action("wp_enqueue_scripts","enqueue_files"); <style> <!----------------- paste css in style.css file only -------------------> <!------------ in woocommerce product slide effect css -----------------> .outer_image_container { position: relative; } .show_box_effect { position: absolute; background: #2f2f2f; width: 80%; height: 1%; top: -80%; left: 0; right: 0; bottom: 0; margin: auto; transition: 0.5s all; z-index: -1; opacity: 0; display: flex; } ul.products li.product:hover .show_box_effect { position: absolute; background: #2f2f2f; width: 80%; height: 80%; top: 0; left: 0; right: 0; bottom: 0; margin: auto; transition: 0.5s all; z-index: 1; opacity: 1; display: flex; } a.custom_add_to_cart { background: none; text-align: center;

How to get posts with pagination in wordpress?

<?php  // Register Custom Post Type function schedule_post_type() {  $labels = array(   'name'                  => _x( 'schedule', 'Post Type General Name', 'text_domain' ),   'singular_name'         => _x( 'schedule', 'Post Type Singular Name', 'text_domain' ),   'menu_name'             => __( 'schedule', 'text_domain' ),   'name_admin_bar'        => __( 'schedule', 'text_domain' ),   'archives'              => __( 'Item Archives', 'text_domain' ),   'attributes'            => __( 'Item Attributes', 'text_domain' ),   'parent_item_colon'     => __( 'Parent Item:', 'text_domain' ),   'all_items'             => __( 'All Items', 'text_domain' ),   'add_new_item'          => __( 'Add New Item', 'text_domain' ),   &#

How to create wp_editor/Custom editor in wordpress/Woo-commerce?

Create wp_editor/Custom editor in wordpress/Woo-commerce. add_action("admin_init", "certifications"); add_action('save_post', 'save_subdescription'); function certifications(){ add_meta_box("sub_description", "Certifications", "meta_function", "product"); } function meta_function(){ global $post; $custom = get_post_custom($post->ID); $sub_description = $custom["sub_description"][0]; wp_editor( $sub_description, 'certifications', $settings = array('textarea_name'=>'sub_description','dfw'=>true) ); } function save_subdescription(){ global $post; update_post_meta($post->ID, "sub_description", $_POST["sub_description"]); } function show_certification_content(){ echo get_post_meta( get_the_ID(), 'sub_description', true ); //echo get_the_content(); } add_action('woocommerce_before_single_product_su

How to send email in wordpress?

Send email in wordpress. $contactfirstname ="lali"; // No need to make changes below this line.  $toadmin = "developwithjaspreet@gmail.com"; $adminmessage = 'You just got one visitor. Here is the detail below'; $noreply = 'noreply@jaspreet797386@gmail.com'; $headers = "From: " . $contactfirstname . "\r\n";             $headers .= "Reply-To: ". strip_tags($noreply) . "\r\n";             $headers .= "MIME-Version: 1.0\r\n";             $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $headers = 'From: "' . $contactfirstname . '" <no-reply@randhirstudsios.com>' . "\r\n"; wp_mail( $toadmin, $contactfirstname, $adminmessage, $headers );

How to send email after saving post in wordpress?

Send email after saving post in wordpress function action_publish_post( $ID, $post ) {  $contactfirstname ="Jassi"; // No need to make changes below this line.  $toadmin = "developwithjaspreet@gmail.com"; $adminmessage = 'You just got one visitor. Here is the detail below'; $noreply = 'noreply@jaspreet797386@gmail.com'; $headers = "From: " . $contactfirstname . "\r\n";             $headers .= "Reply-To: ". strip_tags($noreply) . "\r\n";             $headers .= "MIME-Version: 1.0\r\n";             $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $headers = 'From: "' . $contactfirstname . '" <no-reply@randhirstudsios.com>' . "\r\n"; wp_mail( $toadmin, $contactfirstname, $adminmessage, $headers ); }          // add the action  add_action( 'publish_contracts', 'action_publish_post&#

How To Disable or Block Inspect Element in Browser/Website?

Disable or Block Inspect Element in Browser/Website <body oncontextmenu="return false;"> </body> document.onkeydown = function(e) {   if(event.keyCode == 123) {      return false;   }   if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {      return false;   }   if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {      return false;   }   if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {      return false;   }   if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {      return false;   } }