This file contains 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 | |
$hostsFile = ""; | |
const SLEEP_TIME_SECONDS = 3600; // An hour | |
function addLine($line, $lineBreaksBefore = 0, $lineBreaksAfter = 0) { | |
global $hostsFile; | |
for ($i = 0; $i<$lineBreaksBefore; $i++) { | |
$hostsFile .= "\n"; |
This file contains 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
textarea_html | |
exploded_textarea | |
dropdown | |
colorpicker | |
textfield | |
attach_image | |
checkbox | |
iconpicker | |
linecons | |
vc_link |
This file contains 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 | |
/** | |
* Zero browser caching for PDF files. | |
*/ | |
add_filter( 'rocket_htaccess_mod_expires', function ( $rules ) { | |
$rules .= '# Expires headers for PDF' . PHP_EOL; | |
$rules .= '<IfModule mod_expires.c>' . PHP_EOL; | |
$rules .= 'ExpiresByType application/pdf "access plus 0 seconds"' . PHP_EOL; | |
$rules .= '</IfModule>' . PHP_EOL . PHP_EOL; |
This file contains 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('vc_google_fonts_get_fonts_filter','custom_fonts'); | |
// $font_list from js_composer/include/params/google_fonts/google_fonts.php | |
function custom_fonts( $fonts_list ) { | |
$fonts_list = array(); | |
$open_sans = new stdClass(); | |
$open_sans->font_family = 'Open Sans'; | |
$open_sans->font_styles = '300,300italic,regular,italic,600,600italic,700,700italic,800,800italic'; |
This file contains 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
// open all accordions with click on button | |
add_action( 'wp_footer', function() { ?> | |
<script> | |
( function( $ ) { | |
'use strict'; |
This file contains 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 | |
/** | |
* WP Rocket: | |
* 1. Customise order of minification and defer operations. | |
* 2. Exclude file from defer JS only (still minified). | |
* | |
* Tested rudimentary with WP Rocket 2.11.7 and 3.0.x. | |
* Test before using this in production! | |
*/ | |
add_action( 'wp_rocket_loaded', function () { |
This file contains 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 | |
add_action('template_redirect', function(){ | |
if ( headers_sent() ) { | |
return; | |
} | |
do_action('wp_enqueue_scripts'); | |
foreach( array('style' => wp_styles(), 'script' => wp_scripts()) as $as => $wp_links ) { | |
$link = ''; |
This file contains 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
//Refarence themeshaper | |
function theme_name_fonts_url() { | |
$fonts_url = ''; | |
$OpenSans = _x( 'on', 'OpenSans font: on or off', 'theme-slug' ); | |
$Montserrat = _x( 'on', 'Montserrat font: on or off', 'theme-slug' ); |
This file contains 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 get_header(); ?> | |
<!-- BLOG AREA --> | |
<section> | |
<hr class="no-margin" /> | |
<div class="blog-container section-content"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-8"> | |
<div class="box-layer custom-padding"> | |
<section> |
This file contains 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 | |
/** | |
* Disables Minify for inline CSS. | |
* https://github.com/wp-media/wp-rocket/blob/v2.11.3/inc/front/minify.php#L72 | |
*/ | |
add_filter( 'rocket_minify_html_options', function ( $html_options ) { | |
$html_options = array(); | |
return $html_options; |