Skip to content

Instantly share code, notes, and snippets.

View sandeshjangam's full-sized avatar
🎯
Focusing

Sandesh sandeshjangam

🎯
Focusing
View GitHub Profile
@sandeshjangam
sandeshjangam / gist:17e3280558d3748c1c1c7f42562bc13a
Created December 20, 2017 11:39
How to remove excerpt on blog page?
add_filter( 'the_excerpt', 'ast_custom_blog_remove_excerpt' );
function ast_custom_blog_remove_excerpt( $content ) {
/* If it is blog page then set $content empty. */
if ( is_home() ) {
$content = '';
}
return $content;
@sandeshjangam
sandeshjangam / user-throgh-ftp
Created January 11, 2018 05:34
Add user in WordPress through FTP
<?php
add_action( 'init', 'add_new_user' );
function add_new_user() {
$website = "http://example.com";
$userdata = array(
'user_login' => 'user_name',
'user_url' => $website,
@sandeshjangam
sandeshjangam / remove-checkout-filed-example.php
Last active August 29, 2018 09:35
Remove WooCommerce checkout page fields - sandeshjangam.com
<?php
/* This Code Will Removes "company", "address1" & "address2" Checkout Fields */
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_checkout_fields' );
function custom_remove_checkout_fields( $fields ) {
/* Billing Field */
unset( $fields['billing']['billing_company'] );
unset( $fields['billing']['billing_address_1'] );
unset( $fields['billing']['billing_address_2'] );
@sandeshjangam
sandeshjangam / product-custom-field-on-checkout.php
Last active June 13, 2019 09:52
Custom field to product on checkout page
<?php
/* Add custom domain Field */
add_action('woocommerce_after_order_notes', 'customise_checkout_field');
function customise_checkout_field( $checkout ) {
echo '<div id="cst_add_domain_name">';
woocommerce_form_field(
@sandeshjangam
sandeshjangam / conversion-sample.php
Created March 31, 2020 07:46
Everflow conversion sample
add_action( 'wp_head', 'ev_add_ev_code_in_head' );
function ev_add_ev_code_in_head(){
global $post;
$head_code = '';
if( 'cartflows_step' === $post->post_type ){
@sandeshjangam
sandeshjangam / restrict-specific-product-quantity.php
Created April 23, 2020 17:23
Restrict Specific Product Quantity in Multiples of X on Cart and Before Checkout
/**
* @snippet Restrict Specific Product Quantity in Multiples of X on Cart and Before Checkout
* @link https://www.techiesandesh.com/woocommerce-product-quantity-multiples-cart-page-checkout/
* @author Sandesh Jangam
* @donate $50 https://www.paypal.me/SandeshJangam/50
*/
add_action( 'woocommerce_checkout_process', 'ts_minimum_order_item_count' );
@sandeshjangam
sandeshjangam / Debug help function in Core Php's function
Last active June 19, 2021 06:54
Useful debug function for developer
<?php
/**
* Create `help-vl.php` in php location and add below code in that file.
* Search `auto_prepend_file` in `php.ini`
* Replace it with file location `auto_prepend_file ="your-location\php\help-vl.php"`
*
*
*/
if ( ! function_exists( 'vl' ) ) :
/**
@sandeshjangam
sandeshjangam / woocommerce-add-new-tab-my-account-page.php
Last active April 14, 2022 08:17
WooCommerce - Add New “Tab” at My Account Page
<?php
/**
* @snippet WooCommerce How To Add New Tab @ My Account
* @how-to Watch tutorial @ https://techiesandesh.com
* @author Sandesh Jangam
* @compatible WooCommerce 3.6.2
* @donate $7 https://www.paypal.me/SandeshJangam/7
*/
/**
@sandeshjangam
sandeshjangam / Download File with Node.md
Created September 28, 2022 11:31 — forked from gkhays/Download File with Node.md
Download a file from a URL using Node.js

Download File from URL

Proof-of-concept to download a file from a URL and save it locally. For example, I may wish to retrieve a JAR file from Nexus.

Uses the http package, which does the basics with raw HTTP protocol support.

Possible update: use request, it is like the Python's requests library. There is a companion package called node-request-progress that tracks download progress. See request-progress on GitHub.

Note: The request package has been deprecated.