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 kia_translate_billing_details_when_free( $translated_text, $untranslated_text, $domain ) { | |
if ( function_exists( 'wc' ) && 'woocommerce' === $domain ) { | |
//make the changes to the text | |
switch( $untranslated_text ) { | |
case 'Billing details': | |
if ( ! WC()->cart->needs_shipping() && 0.0 === floatval( WC()->cart->get_total( 'edit' ) ) ) { | |
$translated_text = __( 'NOT billing details', 'kia_textdomain' ); |
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 | |
/** | |
* Load icons dynamically into the `icon_picker` select field. | |
* | |
* @param array $field field options. | |
* @return array new field choices. | |
* | |
* @author JC Palmes | |
*/ | |
function acf_load_icon_picker_field_choices( $field ) { |
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 | |
/* | |
Plugin Name: ACF Auto Sync | |
Plugin URI: | |
Description: Plugin that automatically syncs the database with local json | |
Version: 1.0 | |
Author: Noah Duncan <[email protected]> | |
Updated by: Alfredo Navas <[email protected]> | |
*/ |
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
// Turn debugging on | |
define('WP_DEBUG', true); | |
// Tell WordPress to log everything to /wp-content/debug.log | |
define('WP_DEBUG_LOG', true); | |
// Turn off the display of error messages on your site | |
define('WP_DEBUG_DISPLAY', false); | |
// For good measure, you can also add the follow code, which will hide errors from being displayed on-screen |
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
/** | |
* Change Locale Dynamically in WordPress. | |
* | |
* @author Guy Dumais. | |
* @link https://en.guydumais.digital/change-locale-dynamically-in-wordpress/ | |
*/ | |
// Filters all language attributes in the html tag. | |
add_filter( 'language_attributes', $af = function( $output, $doctype ) { |
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 | |
/** | |
* Sort forms in Gravity Forms block in alphabetical order. | |
* | |
* @param array $forms A collection of active forms on site. | |
*/ | |
add_filter( 'gform_block_form_forms', function( $forms ) { | |
usort( $forms, function( $a, $b ) { |
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 | |
// in the loop | |
$category = get_the_category(); | |
$currentcat = $category[0]->cat_ID; | |
$currentcatname = $category[0]->cat_name; | |
$currentcatslug = $category[0]->slug; | |
// outside the loop | |
global $post; | |
$categories = get_the_category($post->ID); |
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 | |
// Add to existing function.php file | |
// Disable support for comments and trackbacks in post types | |
function df_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
if(post_type_supports($post_type, 'comments')) { | |
remove_post_type_support($post_type, 'comments'); |
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
.visible-android { | |
display:none; | |
} | |
.visible-ios { | |
display:none; | |
} | |
.on-device .visible-android, .on-device .visible-android { | |
display:inherit; | |
} | |
.device-ios .visible-android { |
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
$(document).ready(function() { | |
$('.carousel').carousel(); | |
$(".carousel-indicators li:first").addClass("active"); | |
$(".carousel-inner .item:first").addClass("active"); | |
}); |
NewerOlder