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 / custom-post.php
Last active May 16, 2018 13:20
wordpress custom post
<?php
/***
* REGISTER CUSTOM POST
*/
add_action( 'init', function(){
register_post_type( 'android_apps',
array(
'labels' => array(
'name' => 'Apps',
@webhasan
webhasan / functions.php
Created January 26, 2014 04:42
wp ajax comment reply
if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' );
@webhasan
webhasan / gist:8628544
Created January 26, 2014 04:47
wp post excerpt
/**
* Function for post excerpt
*/
function excerpt($num) {
$limit = $num+1;
$excerpt = explode(' ', get_the_excerpt(), $limit);
array_pop($excerpt);
$excerpt = implode(" ",$excerpt)." <a href='" .get_permalink($post->ID) ." ' class='".readmore."'>Read More &rsaquo;&rsaquo;</a>";
echo $excerpt;
@webhasan
webhasan / menu-functions.php
Last active January 4, 2016 13:29
wp nav descriptions
/**
* Register menu description
*/
class Menu_With_Description extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
@webhasan
webhasan / jquery.fitvids.js
Created January 26, 2014 05:30
js: responsive video
/*global jQuery */
/*jshint multistr:true browser:true */
/*!
* FitVids 1.0.3
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
* Date: Thu Sept 01 18:00:00 2011 -0500
@webhasan
webhasan / theme-unit-test-data.xml
Created January 26, 2014 05:40
wp: theme testing xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is a WordPress eXtended RSS file generated by WordPress as an export of your site.
It contains information about your site's posts, pages, comments, categories, and other content.
You may use this file to transfer that content from one site to another.
This file is not intended to serve as a complete backup of your site.
To import this information into a WordPress site follow these steps:
1. Log in to that site as an administrator.
2. Go to Tools: Import in the WordPress admin panel.
@webhasan
webhasan / making-theme-options.php
Last active January 4, 2016 13:39
wp: options tree
Use options Tree as theme mood:
<?php
add_filter( 'ot_show_pages', '__return_false' );
add_filter( 'ot_show_new_layout', '__return_false' );
add_filter( 'ot_theme_mode', '__return_true' );
@webhasan
webhasan / realted-post.php
Created January 26, 2014 05:47
wp: related post
<?php $orig_post = $post;
global $post;
$categories = get_the_category($post->ID);
if($categories){
$categori_id = array();
foreach ($categories as $category) {
@webhasan
webhasan / calender.css
Created January 26, 2014 05:50
wp: calendar css
/* calendar widget */
.widget_calendar {float: left;}
#wp-calendar {width: 100%; max-width: 100%;}
#wp-calendar caption { text-align: right; color: #333; font-size: 12px; margin-bottom: 15px; }
#wp-calendar thead { font-size: 10px; }
#wp-calendar thead th { padding-bottom: 10px; }
#wp-calendar tbody { color: #aaa; max-width: 100%;}
#wp-calendar tbody td a {color:#3d99ca;}
#wp-calendar tbody td { background: #f5f5f5; border: 1px solid #fff; text-align: center; padding:8px;}
#wp-calendar tbody td:hover { background: #fff; }
@webhasan
webhasan / comment.css
Last active May 13, 2018 05:47
wp: comment css
.comments-area {
margin-top: 3em;
}
.comments-area > h3 {
font-size: 18px;
}
#comments {
font-size: 16px;
color:#333;
}