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 / 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 / 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 / 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 / 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 / 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 / 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 / class-my-custom-taxonomies.php
Last active August 29, 2015 14:13
WordPress Custom Taxonomy
<?php
/**
* The core plugin class file
*
* Defines the functions necessary to register our custom taxonomies with
* WordPress.
*
* @link http://code.tutsplus.com/series/the-beginners-guide-to-wordpress-taxonomies--cms-706
* @since 1.0.0
@webhasan
webhasan / plugins.php
Created January 23, 2015 13:13
TinyMCE Dummy Content Generator
add_action('admin_head', function(){
global $typenow;
//only post type post and page
if(! in_array($typenow, array('post','page'))) {
return;
}
add_filter('mce_external_plugins', function( $plugin_array){
$plugin_array['dummytext_plugin'] = plugins_url( '/js/tinymce-plugin.js', __FILE__ );
@webhasan
webhasan / responsive.css
Last active August 29, 2015 14:16
DIVI Theme Media Query
@media only screen and (max-width: 1100px) and (min-width: 981px) { /* content widht: 960px */
}
@media only screen and (max-width: 980px) { /* content widht: 690px */
}
@media only screen and (max-width: 767px) { /* content widht: 400px */
@webhasan
webhasan / click-to-scroll.js
Last active June 11, 2021 04:03
Click to scroll menu
var navHeight = 0; //use valut for sticky menu height
$(document).on("scroll", onScroll);
$('#main-menu ul a[href*="#"]:not([href="#"]), #sidr a[href*="#"]:not([href="#"]').on('click', function (e) {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
e.preventDefault();