Disable comments section for a Single Page

You have to follow the below steps to disable comment section for a single page.

  1. Go to Dashboard -> Pages
  2. Select the particular page you want to disable comment.
  3. Click on Screen Options tab and check the box beside Discussion WordPress Screen Options
  4. Now scroll down to the bottom, you will find a discussion section. Uncheck Allow Comments & Allow trackbacks and pingbacks on this page.
  5. And Click Publish/Update

Have any doubt, then comment here!

Remove WordPress emoji code programmatically without plugin

WordPress added the following code in your header for support emoji.

window._wpemojiSettings = {"baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/your-url\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.2.1"}};
    !function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f;c.supports={simple:d("simple"),flag:d("flag")},c.supports.simple&&c.supports.flag||(f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
img.wp-smiley,
img.emoji {
    display: inline !important;
    border: none !important;
    box-shadow: none !important;
    height: 1em !important;
    width: 1em !important;
    margin: 0 .07em !important;
    vertical-align: -0.1em !important;
    background: none !important;
    padding: 0 !important;
}

you can remove this WordPress emoji code by WordPress actions. Add the following codes in your functions.php file located in your theme folder.

/*Remove WordPress emoji code programmatically without plugin*/
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');

remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );

Have any doubt, then comment here!

Get Product id from order id in Woocommerce

If you want to get Product id from order id in Woocommerce then fetch order details.

$order = new WC_Order( $order_id );
$items = $order->get_items();

then if you loop through them, you can get all the relevant data:

foreach ( $items as $item ) {
    $product_name = $item['name'];
    $product_id = $item['product_id'];
    $product_variation_id = $item['variation_id'];
}

Have any doubt, then comment here!

Get list of all woocommerce orders by date

If you want to get list of all woocommerce orders by date then using below code. Here change the value of $your_date by yourself.
Assign particular date to $your_date. This code will return the list of woocommerce orders placed in a particular date.

	$your_date = '2016-09-23';
	$args = array(
			'post_type' => 'shop_order',
			'post_status' => 'publish',
			'posts_per_page' => -1,
			'date_query'=> array(
					'after' => $your_date,
					'inclusive' => true,
					)
		);
	$orders = get_posts($args);

Have any doubt, then comment here!

Set blog page programmatically in WordPress

If you want to set blog page programmatically in WordPress then add that following code in your functions.php file. First you have to make sure that blog page is exists or not. if its no exists then create it. After that add that following code in your functions.php file

$blog   = get_page_by_title( 'Blog' );
update_option( 'page_for_posts', $blog->ID );

Have any doubt, then comment here!

Set front page programmatically in WordPress

If you want to set front page programmatically in WordPress then add that following code in your functions.php file. First you have to make sure that front page is exists or not. if its no exists then create it. After that add that following code in your functions.php file

$home = get_page_by_title( 'Home' );
update_option( 'page_on_front', $home->ID );
update_option( 'show_on_front', 'page' );

Have any doubt, then comment here!

Change Payment Method Label on Checkout

There is no hooks available to change payment method label in woocommerce checkout page. You can change this label by use your woocommerce checkout settings.

For example
http://www.boopathirajan.com/wp-admin/admin.php?page=wc-settings&tab=checkout

Here replace http://www.boopathirajan.com instead of your web site name.

Reserved Terms in WordPress