Font Awesome Brand and social Icons with brand color
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
wp_enqueue_style( 'dmc-google-font-fragment', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@300&family=Roboto:ital,wght@0,500;1,400&display=swap', array(), null ); | |
function dmc_google_font_loader_tag_filter( $html, $handle ) { | |
if ( $handle === 'dmc-google-font-fragment' ) { | |
$rel_preconnect = "rel='stylesheet preconnect'"; | |
return str_replace( | |
"rel='stylesheet'", | |
$rel_preconnect, | |
$html |
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
# Redirect requests to /wp-content/uploads/* to production | |
set $production themotoringnetwork.com.au; | |
location @prod_uploads { | |
rewrite "^(.*)/wp-content/uploads/(.*)$" "https://$production/wp-content/uploads/$2" break; | |
} | |
# Rule for handling local requests for images | |
location ~ "^/wp-content/uploads/(.*)$" { | |
try_files $uri @prod_uploads; |
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
get from a remote file to STDOUT: | |
wget -qO- https://www.membrane-australasia.org/gallery/imstec-2016-adelaide-part-3/ | | |
grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | | |
grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | | |
uniq | |
get from a remote file to xargs and download each URL | |
wget -qO- https://www.membrane-australasia.org/gallery/imstec-2016-adelaide-part-1/ | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | uniq | xargs -n 1 -P 24 curl -LO |
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
wp post list --post_type=dmc-sief-project --fields=ID --format=csv | xargs -I % wp post meta delete % _thumbnail_id |
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
# push a local WP database to an existing staging site | |
# uses current directory as theme path and ssh alias | |
pushstage() { | |
START=$(date +%s) | |
# make a backup of the current local database | |
# get current directory name, used for database and URL | |
current=${PWD##*/} | |
cd ~/Sites/$current || return | |
# rsync the local database to staging site |
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
# pull a production WP database to an existing local site | |
# uses current directory as theme path and ssh alias | |
pullprod() { | |
START=$(date +%s) | |
# get current directory name, used for database and URL | |
# TODO: use echo get_template_directory() and get characters from right to first / | |
current=${PWD##*/} | |
cd ~/Sites/$current | |
# make a backup of the current local database | |
wp db export _db.sql |
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
// thanks to Mike Little on WP-hackers | |
add_filter( 'all_plugins', 'dmc_remove_some_plugins' ); | |
function dmc_remove_some_plugins( $all ) { | |
global $current_user; | |
$remove_these = array( | |
'limit-login-attempts/limit-login-attempts.php', | |
'wordpress-firewall-2/wordpress-firewall-2.php', | |
'update-notifier/update-notifier.php', | |
'wp-super-cache/wp-cache.php', |
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 elseif ( has_post_thumbnail() ) : | |
$featured_image_link = ( get_field( 'featured_image_links_to' ) ); | |
if ( $featured_image_link ) { | |
echo '<a href="'.get_permalink($post_object->ID) .'">'; | |
if ( has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); } | |
echo '</a>'; | |
} else { | |
the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); | |
}; | |
endif; ?> |
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
# for initial site deployment to staging server, excludes dev tools and build files | |
# uses current directory as theme path and ssh alias | |
# 3 user inputs: dbname, dbuser, dbpass | |
firstdeploy() { | |
current=${PWD##*/} | |
cd ~/Sites/$current || return | |
echo "Staging database name:" | |
read dbname | |
echo "Staging database user:" |
NewerOlder