Skip to content

Instantly share code, notes, and snippets.

View ikamal7's full-sized avatar
💻
Tea & Code

Kamal Hosen ikamal7

💻
Tea & Code
View GitHub Profile
<?php
$terms = get_terms( 'company_tax',array(
'hide_empty' => false,
'pad_counts' => true,
));
foreach($terms as $term){
wp_update_term_count($term->term_id, 'company_tax', false);
}
<?php
/**
* The below function will help to load template file from plugin directory of wordpress
*
*/
define( 'PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
/**
* pp_get_template_part
*
<?php
/**
* Plugin Name: WP Rating Reviews
* Plugin URI: http://imdev.xyz/plugins/wprr
* Description: Allows your visitors to leave business / product reviews.
* Version: 1.0.0
* Author: Kamal Hosen
* Author URI: http://imdev.xyz/
* Text Domain: wp-rating-reviews
* Domain Path: /languages/
<?php
/**
* Bangla Date translate class for WordPress
*
* Converts English months, dates to equivalent Bangla digits
* and month names.
*
* @author Tareq Hasan <[email protected]>
*/
class WP_BanglaDate {
@ikamal7
ikamal7 / related post by multiple categories
Created July 26, 2018 18:09
Related post Query using multiple categories.
<?php
function relatedPostsbyCategory()
{
$original_post = $post;
global $post;
$categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach ($categories as $individual_category) $category_ids[] = $individual_category->term_id;
<?php
if ( ! function_exists( 'name_fonts_url' ) ) :
/**
* Register Google fonts for Your theme
*
* Create your own name_fonts_url() function to override in a child theme.
// Add smooth scrolling to all links
$('a[href^="#"]').on('click', function(e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
.col-xs-offset-right-12 {
margin-right: 100%;
}
.col-xs-offset-right-11 {
margin-right: 91.66666667%;
}
.col-xs-offset-right-10 {
margin-right: 83.33333333%;
}
.col-xs-offset-right-9 {
jQuery(".main-menu ul ul").parent("li").children("a").append(' <i class="fa fa-angle-down"></i>')
/*
* ----------------------------------------------------------------------------------------
* STICKY JS
* ----------------------------------------------------------------------------------------
*/
$(window).on('scroll',function() {
var scroll = $(window).scrollTop();
if (scroll < 30) {
$(".header-area").removeClass("scroll-header");
}else{