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 / 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) {
}
@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 / 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 / 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 / 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 / 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 / gist:8764037
Created February 2, 2014 07:05
css: niddel shape
hr.shape {
background-color: #dcdbdb;
background-image: -moz-linear-gradient(left, #ffffff 0%, #dcdbdb 50%, #ffffff 100%);
background-image: -o-linear-gradient(left, #ffffff 0%, #dcdbdb 50%, #ffffff 100%);
background-image: -webkit-linear-gradient(left, #ffffff 0%, #dcdbdb 50%, #ffffff 100%);
background-image: linear-gradient(left, #ffffff 0%, #dcdbdb 50%, #ffffff 100%);
border: none;
height: 1px;
margin: 1.5em auto;
width: 100%;
@webhasan
webhasan / color.css
Created February 2, 2014 03:45
Beautifu color
/*
Beautiful link color
*/
a {
color:#50AAEB;
}
@webhasan
webhasan / popular_post.php
Last active February 28, 2017 08:27
wp: post view count
/**
* Function for post counter table
* Show post cunter and use
* show more view post as popular
*/
//Create function for new table for post counter
function wpb_set_post_views($postID) {
$count_key = 'wpb_post_views_count';
$count = get_post_meta($postID, $count_key, true);
@webhasan
webhasan / populat_post.php
Created January 29, 2014 09:47
wp: post query by comment_count
<?php
$pop = $wpdb->get_results("SELECT id,post_title,guid FROM {$wpdb->prefix}posts WHERE post_type='post' ORDER BY comment_count DESC LIMIT 10");
foreach($pop as $post) : ?>
<li><a href="<?php echo $post->guid; ?>"><?php echo get_the_post_thumbnail($post->id); ?></li>
<?php endforeach; ?>