Skip to content

Instantly share code, notes, and snippets.

View webhasan's full-sized avatar
🎯
GTM, GA4, Conversion Tracking (Coding Ninja)

Md Hasanuzzaman webhasan

🎯
GTM, GA4, Conversion Tracking (Coding Ninja)
View GitHub Profile
@webhasan
webhasan / ajax.js
Last active August 29, 2015 14:11
WordPress Ajax implementation
jQuery(document).ready(function() {
var GreetingAll = jQuery("#GreetingAll").val();
jQuery("#PleasePushMe").click(function(){ jQuery.ajax({
type: 'POST',
url: my_ajax_script.ajaxurl,
data: {
action: 'get_my_option',
GreetingAll: GreetingAll,
},
@webhasan
webhasan / comment-filed.php
Created December 17, 2014 04:34
Customize Comment Form
comment_form( $args );
$args = array(
'fields' => apply_filters(
'comment_form_default_fields', array(
'author' =>'<p class="comment-form-author">' . '<input id="author" placeholder="Your Name (No Keywords)" name="author" type="text" value="' .
esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />'.
'<label for="author">' . __( 'Your Name' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'</p>'
@webhasan
webhasan / shop.html
Last active August 29, 2015 14:11
Woocomrec DEFAULT CODING STRUCTURE
<!-- loop page -->
<div id="content" role="main">
<nav class="woocommerce-breadcrumb" >
<a class="home" href="http://localhost/woocommerce">Home</a> &#47; Shop
</nav>
<h1 class="page-title">Shop</h1>
<p class="woocommerce-result-count">
Showing all 4 results</p>
<form class="woocommerce-ordering" method="get">
@webhasan
webhasan / woocommerce.php
Last active August 29, 2015 14:10
woocommerce templating
<?php
// remove all style for woocommerce template
define('WOOCOMMERCE_USE_CSS', false);
//woocommere custom looping
<section id="recent">
<h1>Recently Added</h1>
@webhasan
webhasan / script.js
Created October 22, 2014 09:42
smooth scroll
jQuery(document).ready(function ($) {
$(".scroll").click(function (event) {
event.preventDefault();
$('html,body').animate({scrollTop: $(this.hash).offset().top}, 1200);
});
});
/**
* @uses : have to add .scroll
@webhasan
webhasan / shortcode.php
Created October 16, 2014 02:12
wp shortcode
add_shortcode('em_vedio',function($atts){
$atts = shortcode_atts(array(
'firstname' => 'Hasanuzzaman',
'lastname' => 'Shozib',
'tilte' => 'Just for testing title'
),$atts,'em_vedio');
@webhasan
webhasan / gist:7527f34227374c605b6f
Last active August 29, 2015 14:05
Query for multipul table joining
$query = sprintf("SELECT *
FROM `product`
WHERE `id`
IN ( SELECT `product_id` FROM `customar_product` WHERE `user_id`='%d' )", $_GET['id']);
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];
$template_file = get_post_meta($post_id, '_wp_page_template', TRUE);
if ($template_file == 'welcome.php') {
ot_register_meta_box( $home_page_meta_box );
}
/* -------------------------------------------------------------
@webhasan
webhasan / SPEEDUP.txt
Last active May 13, 2017 16:19
WP SPEED UP WORDPRESS SITE
*************************
SPEED UP WORDpRESS SITE
*************************
1. IDENTIFY PLUGINS THAT ARE SLOWING YOU DOWN
https://wordpress.org/plugins/p3-profiler/
Use this plugins for showing how to sepped up.
2.Enable Gzip
/***
Enable Gzip Compression
***/
.htaccess code
..............
***Start Bellow ****
AddOutputFilterByType DEFLATE text/plain