Skip to content

Instantly share code, notes, and snippets.

View amElnagdy's full-sized avatar

Ahmed Mohammed Nagdy amElnagdy

View GitHub Profile
@amElnagdy
amElnagdy / functions.php
Created September 26, 2019 22:23
Disable the emoji's for WordPress
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
@amElnagdy
amElnagdy / nginx.conf
Created September 26, 2019 18:27
Enable GZIP on NGINX
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_vary on;
gzip_types text/plain text/css text/javascript image/svg+xml image/x-icon application/javascript application/x-javascript;
@amElnagdy
amElnagdy / .htaccess
Created September 26, 2019 18:25
Enable GZIP compression on Apache .htaccess. Make sure mod_filter is loaded on your server, otherwise the AddOutputFilterByType directive will not work and could cause a 500 error.
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
<?php
/**
* Display Divi Settings for all custom post types
*
* @package DiviColt
* @since 1.1
*/
add_action('add_meta_boxes', 'divicolt_add_meta_box');
function divicolt_add_meta_box()
function custom_style() {
if ( is_page( 'PAGE_ID' ) ) {
wp_enqueue_style( 'home', get_stylesheet_directory_uri() . '/home.css' );
}
}
add_action( 'wp_enqueue_scripts', 'custom_style' );
<?php
// Divi Builder on custom post types by https://wpcolt.com
add_filter('et_builder_post_types', 'divicolt_post_types');
add_filter('et_fb_post_types','divicolt_post_types' ); // Enable Divi Visual Builder on the custom post types
function divicolt_post_types($post_types)
{
foreach (get_post_types() as $post_type) {
if (!in_array($post_type, $post_types) and post_type_supports($post_type, 'editor')) {
$post_types[] = $post_type;
}
/*
Theme Name: Twenty Sixteen Child
Template: twentysixteen
*/
add_action ( 'wp_enqueue_scripts', 'bootstrap_cdn_scripts_styles', 10 );
function bootstrap_cdn_scripts_styles() {
wp_enqueue_style( 'bootstrap-css', '//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css', array(), '3.0.3', 'all' );
wp_enqueue_script( 'bootstrap-js', '//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js', array(), '3.0.3', true );
}
function jlwp_register_mdlcss() {
wp_register_style( 'material.indigo-pink.min', get_stylesheet_directory_uri() .'/material.min.css', 'all' );
wp_enqueue_style( 'material.indigo-pink.min' );
}
add_action( 'wp_enqueue_scripts', 'jlwp_register_mdlcss' );