Skip to content

Instantly share code, notes, and snippets.

View jimi008's full-sized avatar
:octocat:
Working as DevOps Engineer

Jamil Ahmed jimi008

:octocat:
Working as DevOps Engineer
View GitHub Profile
@jimi008
jimi008 / gfcptaddonbase.php
Created July 15, 2016 12:15 — forked from anonymous/gfcptaddonbase.php
Temp fix for Multiselect of Custom Taxonomies in Gravity Forms + Custom Post Types 3.1
<?php
if (!class_exists('GFCPTAddonBase')) {
/*
* Base class for the GFCPT Addon. All common code is in here and differences per version are overrided
*/
class GFCPTAddonBase {
protected $_has_tag_inputs = false;
@jimi008
jimi008 / functions.php
Created July 19, 2016 10:49
Lazy Load The Facebook Comments Plugin Using JavaScript
<script>
function loadAPI() {
var js = document.createElement('script');
js.src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=YOUR_APP_ID&version=v2.0';
document.body.appendChild(js);
}
window.onscroll = function () {
var rect = document.getElementById('comments').getBoundingClientRect();
if (rect.top < window.innerHeight) {
/dir-that-contains-wp-config/local-config.php
@jimi008
jimi008 / compatibility.js
Created May 23, 2017 07:18 — forked from danielpataki/compatibility.js
jQuery in WordPress
/* Regular jQuery */
$('.hideable').on('click', function() {
$(this).hide();
})
/* Compatibility Mode */
jQuery('.hideable').on('click', function() {
jQuery(this).hide();
})
@jimi008
jimi008 / remove_wordpress_meta.php
Last active October 16, 2017 17:54
Remove Wordpress version meta from page and RSS
<?php
// hide the meta tag generator from head and rss
function disable_version() {
return '';
}
add_filter('the_generator','disable_version');
remove_action('wp_head', 'wp_generator');
?>
@jimi008
jimi008 / remove_revslider_meta_generator.php
Last active May 25, 2018 10:17
Remove woo framework, canvas theme & Revolution slider meta generator from site
<?php
function remove_revslider_meta_tag() {
return '';
}
add_filter( 'revslider_meta_generator', 'remove_revslider_meta_tag' );
?>
@jimi008
jimi008 / README.md
Created October 29, 2017 20:23 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@jimi008
jimi008 / custom-registration.php
Created November 9, 2017 07:17 — forked from trslater/custom-registration.php
Custom Registration Plugin
<?php
/*
Plugin Name: Custom Registration
Description: Updates user rating based on number of posts.
Version: 1.1
Author: Tristan Slater w/ Agbonghama Collins
Author URI: http://kanso.ca
*/
@jimi008
jimi008 / wp-get_id_by_slug
Created December 19, 2017 08:22 — forked from eddt/wp-get_id_by_slug
WordPress: Get page ID from slug
// Usage:
// get_id_by_slug('any-page-slug','any-post-type');
function get_id_by_slug($page_slug, $slug_page_type = 'page') {
$find_page = get_page_by_path($page_slug, OBJECT, $slug_page_type);
if ($find_page) {
return $find_page->ID;
} else {
return null;
}
<?php
/*=========================================
Custom Submit Box
==========================================*/
/**
* Loop throught custom post types and
* replace default submit box
*
* @since 1.0
*