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 / 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 / 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 / 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 / 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();
})
/dir-that-contains-wp-config/local-config.php
@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) {
@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 / How to use Images as Radio buttons.md
Created June 28, 2016 15:01 — forked from rcotrina94/How to use Images as Radio buttons.md
How to use images for radio buttons (input-radio).
@jimi008
jimi008 / functions.php
Created June 6, 2016 21:01
Get Advance Custom Fields Value from Taxonomy Term
<?php
if ( ! function_exists('custom_post_type') ) {
// Register Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Cars', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Car', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Cars', 'text_domain' ),
@jimi008
jimi008 / functions.php
Created June 6, 2016 19:47
Load a stylesheet or Scripts on specific admin pages
<?php
function load_custom_wp_admin_style() {
$pageArr = array(1, 2, 3);
if(isset($_GET['post']) && in_array($_GET['post'], $pageArr)){
wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
wp_enqueue_style( 'custom_wp_admin_css' );
}
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );