Skip to content

Instantly share code, notes, and snippets.

View hmbashar's full-sized avatar
🏠
Working from home

Md Abul Bashar hmbashar

🏠
Working from home
View GitHub Profile
{ "keys": ["ctrl+shift+r"], "command": "reindent", "args": {"single_line":false}}
prefernces>key binding
<?php
"fa-amazon","fa-ambulance","fa-american-sign-language-interpreting","fa-anchor","fa-android","fa-angellist","fa-angle-double-down","fa-angle-double-left","fa-angle-double-right","fa-angle-double-up",
"fa-angle-down","fa-angle-left","fa-angle-right","fa-angle-up","fa-apple","fa-archive","fa-area-chart","fa-arrow-circle-down","fa-arrow-circle-left","fa-arrow-circle-o-down","fa-arrow-circle-o-left",
"fa-arrow-circle-o-right","fa-arrow-circle-o-up","fa-arrow-circle-right","fa-arrow-circle-up","fa-arrow-down","fa-arrow-left","fa-arrow-right","fa-arrow-up","fa-arrows","fa-arrows-alt","fa-arrows-h",
"fa-arrows-v","fa-assistive-listening-systems","fa-asterisk","fa-at","fa-audio-description","fa-backward","fa-balance-scale","fa-ban","fa-bandcamp","fa-bar-chart","fa-barcode","fa-bars","fa-bath",
"fa-battery-empty","fa-battery-full","fa-battery-half","fa-battery-quarter","fa-battery-three-quarters","fa-bed","fa-beer","fa-behance","fa-behance-square","fa-bell","fa-bell-o","fa-bell-slash",
"fa-bell-slash-o","fa-bic
<?php
// Timestamp Convert from date picker
$remove_slash_date = explode('/', dd/m/yy);
$promo_timestamp = mktime(0, 0, 0, (int)$remove_slash_date[0], (int)$remove_slash_date[1], (int)$remove_slash_date[2]);
// Current timestamp from wordpress time admin panel;
$current_wp_date = current_time('timestamp');
<div class="shape-testimonials-left-review">
<div class="row testimonial-masonry-area">
<?php
$shae_testimonial_count = $shape_option['shape-testimonial-tesi-count'];
if(isset($shae_testimonial_count) && !empty($shae_testimonial_count)) {
$shape_tesi_count = $shae_testimonial_count;
}else {
$shape_tesi_count = -1;
}
@hmbashar
hmbashar / wp_kses.php
Last active September 13, 2019 19:07
<?php
/*
Used for: Output that needs to allow some HTML, but not all tags or attributes.
What it does: Strips the content of any tags or attributes that don't match the list of rules passed in.
Use wp_kses if there is a context that allows certain tags (e.g. inline formatting tags like <strong> and <em>) to be printed as HTML.
A basic example would be displaying comments:
//Active Masonry
var $grid_masonry = $('.testimonial-masonry-area').masonry({
itemSelector: '.single-testimonial-masonry',
columnWidth: 1
});
var msnry = $grid_masonry.data('masonry');
//Testimonial infinite-scroll js
$grid_masonry.infiniteScroll({
@hmbashar
hmbashar / theme activition time.php
Last active September 13, 2019 19:07
Set theme activition date and time into wp get_otpion database.
<?php
add_action('after_setup_theme', 'mytheme_init');
function mytheme_init() {
// Check if already saved the activation date & time
// to prevent over-writing if user deactive & active theme
// multiple time
if(!get_option('mytheme_activation_time', false)){
// Generate Current Date & Time in MySQL Date Time Formate
$activation_datetime = current_time( 'mysql' );
// Save it in `wp_options` table
<?php
//save theme active time
function my_theme_activation_init() {
// Check if already saved the activation date & time
// to prevent over-writing if user deactive & active theme
// multiple time
if(!get_option('mytheme_activation_time', false)){
@hmbashar
hmbashar / Smooth Scrolling.js
Created September 13, 2019 18:49
ID to Section scrolling animation.js
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);