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 load_js_assets() { | |
if( is_page( ID ) ) { | |
wp_enqueue_script('my-js', 'PATH TO JS FILE', array('jquery'), '', false); | |
} | |
} | |
add_action('wp_enqueue_scripts', 'load_js_assets'); |
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
/* becuase I always forget */ | |
/* becuase I always forget */ | |
body { | |
background-image: url('https://via.placeholder.com/250x200/d9d9d9/000000'); | |
background-position: center center; | |
background-repeat: no-repeat; | |
// background-attachment: fixed; // remove to be fixed | |
background-size: cover; |
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
new fullpage("#fullpage", { | |
navigation: false, | |
controlArrows: false, | |
afterLoad: function(origin, destination, direction) { | |
var loadedSection = this; | |
if (destination.isFirst) { | |
$("#moveUp").hide(); | |
} else { | |
$("#moveUp").fadeIn(); | |
} |
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
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteRule ^(.*)$ https://productionsite.com/$1 [QSA,L] |
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
$body_padding: 1em; | |
body { | |
height: calc(100% - #{$body_padding}) | |
} | |
// #{$variable} |
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 text before | |
.woocommerce-product-gallery__trigger:before { | |
content: "Click to zoom "; | |
// set both font sizes | |
font-size: 13px; | |
font-size: 0.815rem; | |
letter-spacing: normal; | |
color: red; | |
font-weight: 500; | |
} |
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 | |
$img = the_sub_field( 'image' ); // or get_field ACF - make sure field is set to ID | |
$size = 'home-hero'; // thumbnail size | |
$src = wp_get_attachment_image_src( $img, $size ); | |
$srcset = wp_get_attachment_image_srcset( $img, $size ); | |
?> | |
<img class="pillar-image" | |
src="<?php echo esc_url( $src[0] ); ?>" | |
srcset="<?php echo esc_attr( $srcset ); ?>" |
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 theme_modify_the_main_query( $query ) { | |
if ( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'price' ) { | |
// Modify the main query | |
if( ! is_admin() && $query->is_main_query() ) { | |
$args = array( | |
'relation' => 'AND', | |
'query_one' => array( |
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
* { outline: 2px dotted red } | |
* * { outline: 2px dotted green } | |
* * * { outline: 2px dotted orange } | |
* * * * { outline: 2px dotted blue } | |
* * * * * { outline: 1px solid red } | |
* * * * * * { outline: 1px solid green } | |
* * * * * * * { outline: 1px solid orange } | |
* * * * * * * * { outline: 1px solid blue } |