This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Apache WebP Configuration | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteCond %{HTTP_ACCEPT} image/webp | |
| RewriteCond %{DOCUMENT_ROOT}/$1.webp -f | |
| RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1] | |
| </IfModule> | |
| <IfModule mod_headers.c> | |
| Header append Vary Accept env=REDIRECT_accept |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Customise parameters for critical CSS generator. | |
| */ | |
| add_filter( 'rocket_cpcss_job_request', function ( $item ) { | |
| return array( | |
| 'url' => $item['url'], | |
| 'mobile' => 0, // 1 = Emulate a mobile device | |
| 'viewport_width' => 1300 // px maximum width of the viewport | |
| 'viewport_height' => 900 // px maximum height of the viewport |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * PLEASE SEE COMMENT BELOW: | |
| * https://gist.github.com/glueckpress/0fcd12a8ada43e37e400facd987016a1#gistcomment-3009533 | |
| */ | |
| defined( 'ABSPATH' ) or die(); | |
| /** | |
| * Plugin Name: WP Rocket | Remove Cache Options Meta Boxx | |
| * Description: Removes the Cache Options meta box from Edit screens. | |
| * Author: Caspar Hübinger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function kill_gutenberg_post_type( $is_enabled, $post_type ) { | |
| if ( ‘post’ === $post_type || ‘page’ === $post_type ) { | |
| return false; //==> add_action( ‘admin_print_scripts-edit.php’,…) ==> gutenberg_replace_default_add_new_button is disabled | |
| } | |
| return $is_enabled; | |
| } | |
| add_filter( ‘gutenberg_can_edit_post_type’, ‘kill_gutenberg_post_type’, 10, 2 ); //gutenberg_add_edit_link_for_post_type | |
| function kill_gutenberg_modify_add_new_button_url( $url, $path ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| // Make jQuery WP friendly | |
| (function ($) { | |
| // Initiate after document loads | |
| $( document ).ready(function() { | |
| // Custom function | |
| jQuery('#content a').click(function(){ | |
| jQuery('html, body').animate({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_get_price_html', 'custom_price_message' ); | |
| function custom_price_message( $price ) { | |
| $wording = ' Pricing '; | |
| return $price . $wording; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_get_price_html', 'custom_price_message' ); | |
| function custom_price_message( $price ) { | |
| $wording = ' Pricing '; | |
| return $wording . $price; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /******************* HIDE/SHOW WORDPRESS PLUGINS MENU ITEM *********************/ | |
| /** | |
| * Remove and Restore ability to Add new plugins to site | |
| */ | |
| function remove_plugins_menu_item($role_name){ | |
| $role = get_role( $role_name ); | |
| $role->remove_cap( 'activate_plugins' ); | |
| $role->remove_cap( 'install_plugins' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function remove_read_more_feed_link( $content ) { | |
| $excerpt = strip_tags($content); | |
| $excerpt = str_replace('Read More', ' ', $content); | |
| return $excerpt; | |
| } |