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 | |
/** | |
* @param WP_Query|null $wp_query | |
* @param bool $echo | |
* @param array $params | |
* | |
* @return string|null | |
* | |
* UPDATE for Bootstrap 5.0: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507 | |
* |
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
Download Google Drive files with WGET | |
- replace FILEID with your Google Drive FILEID | |
- Google Drive file must have a public shared URL (file share options) | |
- will create a /tmp/cookies.txt to save cookies, and handle Google Drive "Big files" download verification | |
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt |
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 | |
/** | |
* ACF fix for term meta | |
* replace {{custom_term_meta_x}} by your ACF term custom field name | |
* TODO: loop over all term_meta to auto-generate filters | |
* | |
* https://support.advancedcustomfields.com/forums/topic/how-to-use-wp-term-meta-on-acf-the-easy-way/ | |
*/ | |
function acf_update_term_meta( $value, $post_id, $field ) { |
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 | |
/** | |
* Various removers | |
* todo: all may not be still needed/usefull/correct | |
*/ | |
/** | |
* @param $headers | |
* |
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
/** | |
* ACF save json folder | |
*/ | |
add_filter( 'acf/settings/save_json', 'my_acf_json_save_point' ); | |
function my_acf_json_save_point( $path ) { | |
return get_stylesheet_directory() . '/acf-json-custom-folder'; | |
} | |
/** |
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
# Remove index.php$ | |
if ($request_uri ~* "^(.*/)index\.php$") { | |
return 301 $1; | |
} | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
# Remove from everywhere index.php | |
if ($request_uri ~* "^(.*/)index\.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 | |
/** | |
* Edit default Woocommerce product loop thumbnail template | |
* As there is no dedicated Woocommerce template (eg wp-content/plugins/woocommerce/templates/loop/price.php) | |
* because it's generated using filter, we must remove Woocommerce hook, and add our own "at the same place" | |
* to edit the product loop thumbnail template | |
* tested up to | |
* 14/07/2023 : | |
* Woocommerce 6.2.2 | |
* 12/10/2020 : |
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 | |
/** | |
* Edit checkout form inputs | |
* source: https://gist.github.com/nickkuijpers/5d07ecf9b0a0678b4f4c | |
*/ | |
add_filter('woocommerce_checkout_fields', 'addBootstrapToCheckoutFields' ); | |
/** | |
* @param $fields | |
* @return mixed | |
*/ |
OlderNewer