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 wpa54064_inspect_scripts() { | |
global $wp_scripts; | |
foreach( $wp_scripts->queue as $handle ) : | |
echo $handle; | |
endforeach; | |
} | |
add_action( 'wp_print_scripts', 'wpa54064_inspect_scripts' ); | |
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 add_async_forscript($url) | |
{ | |
if (strpos($url, '#asyncload')===false) | |
return $url; | |
else if (is_admin()) | |
return str_replace('#asyncload', '', $url); | |
else | |
return str_replace('#asyncload', '', $url)."' async='async"; | |
} | |
add_filter('clean_url', 'add_async_forscript', 11, 1); |
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
https://kinsta.com/blog/defer-parsing-of-javascript/ | |
https://mobile1st.com/7-ways-to-improve-mobile-page-speed/ |
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
https://docs.craftcms.com/v3/installation.html#step-1-download-craft | |
Make sure hidden files are visible | |
Download Craft zip file from link above or install with composer: composer create-project craftcms/craft <Path> | |
Open MAMP -- no need to start servers yet -- go to Preferences > Web Server and set the document root to be the "web" folder inside the Craft directory. | |
Set Permissions on directories within project: |
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 | |
//wp-config | |
$blocked_IPs = array( | |
'93.160.60.22', | |
'188.213.49.139' | |
); | |
if (in_array($_SERVER['REMOTE_ADDR'], $blocked_IPs)) { | |
header('HTTP/1.0 301 Moved Permanently'); | |
header('Location: https://www.youtube.com/watch?v=dQw4w9WgXcQ'); |
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
// Register | |
<?php | |
function language_select_widget_init() { | |
register_sidebar( array( | |
'name' => 'Language Select', | |
'id' => 'fdi_language_select', | |
) ); | |
} |
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 | |
$args = [ | |
'post_type' => 'page', | |
'meta_query' => [ | |
[ | |
'key' => '_wp_page_template', | |
'value' => 'page-industry-detail.php' | |
] | |
] | |
]; |
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 | |
$args = [ | |
'post_type' => 'page', | |
'posts_per_page' => -1, | |
]; | |
$query = new WP_Query($args); | |
if ($query->have_posts()) : ?> |
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
open console screen: | |
sudo ./fixperms.sh |
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
// client side solution rather than server (PHP) useful for theme options to create a dynamic copyright date | |
<script type="text/javascript">document.write(new Date().getFullYear())</script> |