Skip to content

Instantly share code, notes, and snippets.

View rafinkarki's full-sized avatar

rafin karki rafinkarki

View GitHub Profile
git branch --delete branch name
git remote update origin --prune
git fetch --prune
@rafinkarki
rafinkarki / FB sdk connection
Created July 27, 2017 03:25
Facebook SDK connection
<?php
session_start();
include_once('community/config.php');
require_once 'src/Facebook/autoload.php';
$fb = new Facebook\Facebook([
'app_id' => $config['fb_api'],
'app_secret' => $config['fb_secret'],
'default_graph_version' => 'v2.4',
]);
@rafinkarki
rafinkarki / excerpt max length
Created July 14, 2016 04:08
excerpt max length
//excerpt max charlenght
function the_excerpt_max_charlength($charlength) {
$excerpt = get_the_excerpt();
$charlength++;
if ( mb_strlen( $excerpt ) > $charlength ) {
$subex = mb_substr( $excerpt, 0, $charlength - 7 );
$exwords = explode( ' ', $subex );
$excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) );
if ( $excut < 0 ) {
@rafinkarki
rafinkarki / gist:674da606b8f70bb20edc3c03eb8135e4
Created June 12, 2016 06:34
Cookie Based Modal Popup Plugin For jQuery - Popup Window
http://www.jqueryscript.net/lightbox/Cookie-Based-Modal-Popup-Plugin-For-jQuery-Popup-Window.html
@rafinkarki
rafinkarki / gist:e9fc18e845e91d5227e3eb12d82fee3d
Created May 20, 2016 03:39
Adding media upload field in category
if ( ! class_exists( 'CT_TAX_META' ) ) {
class CT_TAX_META {
public function __construct() {
//
}
/*
@rafinkarki
rafinkarki / gist:7cab86cb9357a734d720bdfb0df0fa4d
Created April 21, 2016 03:33
popup display after certain time interval
function call() {
//popup = window.open('http://www.google.co.in');
$("#ouibounce-modal").show();
setTimeout(wait, 1000); // closes the pop-up after 8 secs delay
}
function caller(){
$("#ouibounce-modal").show();
setInterval(call, 15000); // opens a pop-up on every 12th second
}