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 / css
Created February 12, 2014 06:43
wp:post pagination
/**
* Style for post pagination
*/
.post-pagination {
width: 100%;
padding:5px;
height: 40px;
border:1px solid #fff;
outline: 1px solid #e3e3e3;
border-radius:3px;
@webhasan
webhasan / functions.php
Created February 12, 2014 08:23
wp: Ajax comment reply
function theme_queue_js(){
if ( (!is_admin()) && is_singular() && comments_open() && get_option('thread_comments') )
wp_enqueue_script( 'comment-reply' );
}
add_action('wp_print_scripts', 'theme_queue_js');
@webhasan
webhasan / query_post.php
Last active April 13, 2019 08:39
wp: query post
<?php
if(is_front_page()){
$paged = ( get_query_var('page') ) ? get_query_var('page') : 1;
}else{
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
}
$the_query = new WP_Query(array(
@webhasan
webhasan / wp: post thumbnail url
Created February 24, 2014 06:05
post-thumbnail.php
<?php
$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
echo $thumb_url[0];
?>
@webhasan
webhasan / align.css
Last active October 10, 2015 09:43
wp: wordpres-align-image-css
.alignnone {
margin: 5px 20px 20px 0;
}
.aligncenter,
div.aligncenter {
display: block;
margin: 5px auto 5px auto;
}
@webhasan
webhasan / media-query.css
Last active May 15, 2016 10:58 — forked from EmranAhmed/less-variable.md
media query
/* Large Devices, Wide Screens */
@media only screen and (max-width : 1199px) {
}
/* Medium Devices, Desktops */
@media only screen and (max-width : 991px) {
}
/***
Enable Gzip Compression
***/
.htaccess code
..............
***Start Bellow ****
AddOutputFilterByType DEFLATE text/plain
@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
$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 / 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']);