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
// Create Page Category Custom Taxonomy (page post type) | |
function register_page_category_taxonomy() { | |
register_taxonomy('page_category', 'page', [ | |
'label' => 'Page Categories', | |
'public' => true, | |
'hierarchical' => true, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
]); |
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 | |
// Open your theme's functions.php file or create a custom plugin. | |
// Add the following code: | |
Add the following code: | |
function remove_custom_meta_boxes() { | |
// Example: remove the 'slugdiv' meta box from the post editor screen | |
remove_meta_box('slugdiv', 'post', 'normal'); |
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 | |
// Register and enqueue Isotope script | |
// Place in theme functions file | |
function cwpai_enqueue_isotope_script() { | |
wp_enqueue_script('isotope', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js', array('jquery'), '3.0.6', true); | |
} | |
add_action('wp_enqueue_scripts', 'cwpai_enqueue_isotope_script'); | |
// Fetch Team Member posts | |
$args = 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
// Add this code to your theme’s functions.php file: | |
function my_custom_shortcode() { | |
ob_start(); // Start output buffering | |
get_template_part('template-parts/my-template'); // Load the template part | |
return ob_get_clean(); // Return the buffered output | |
} | |
add_shortcode('myshortcode', 'my_custom_shortcode'); | |
//This registers [myshortcode] which loads template-parts/my-template.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
// Use acf as image array | |
<?php | |
$image = get_sub_field('FIELD_NAME'); | |
$image_url = $image['sizes']['CUSTOM_SIZE']; | |
?> | |
<img src="<?php echo $image_url; ?>"> |
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
// 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 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 | |
/** | |
* 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 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 | |
/** | |
* 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 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
jQuery(function($){ | |
$('.slick-center').slick({ | |
centerMode: true, | |
centerPadding: '25%', | |
slidesToShow: 1, | |
asNavFor: '.events-content', | |
responsive: [ | |
{ | |
breakpoint: 768, |
NewerOlder