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
<img src="<?php echo wp_get_attachment_image_src( get_sub_field('acf_image_field'), 'custom-image-size' )[0]; ?>" alt="<?php echo $img['alt']; ?>" /> |
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_shortcode('my-shortcode', 'my_shortcode_function'); | |
function my_shortcode_function($atts) { | |
ob_start(); | |
get_template_part('template-parts/my-shortcode'); | |
return ob_get_clean(); | |
} |
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 | |
$slider = new WP_Query(array( 'post_type' => 'project' ) ); | |
if( $slider->have_posts() ) : | |
while($slider->have_posts()) : | |
$slider->the_post(); | |
?> | |
<style type="text/css"> | |
.project-box { | |
background-image: url('<?php the_field('featured_image') ?>'); |
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
// Restricts input for the given textbox to the given inputFilter function. | |
function setInputFilter(textbox, inputFilter, errMsg) { | |
["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu", "drop", "focusout"].forEach(function(event) { | |
textbox.addEventListener(event, function(e) { | |
if (inputFilter(this.value)) { | |
// Accepted value | |
if (["keydown","mousedown","focusout"].indexOf(e.type) >= 0){ | |
this.classList.remove("input-error"); | |
this.setCustomValidity(""); | |
} |
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
.row:after { | |
display: table; | |
content: " "; | |
clear: both; | |
} | |
.col1, | |
.col2, | |
.col3, | |
.col4, |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/** | |
* Hide shipping rates when free shipping is available. | |
* Updated to support WooCommerce 2.6 Shipping Zones. | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ | |
function my_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); |
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
jQuery(function($){ | |
$('.slick-center').slick({ | |
centerMode: true, | |
centerPadding: '25%', | |
slidesToShow: 1, | |
asNavFor: '.events-content', | |
responsive: [ | |
{ | |
breakpoint: 768, |
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 | |
/** | |
* Order product collections by stock status, instock products first. | |
*/ | |
class iWC_Orderby_Stock_Status | |
{ | |
public function __construct() | |
{ |
NewerOlder