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 // don't add this again to the end of functions.php :-) | |
function javi_enqueue_custom_gutenberg_script() { | |
$script_path = get_template_directory() . '/custom-gutenberg.js'; // this is the path into the theme | |
$script_url = get_template_directory_uri() . '/custom-gutenberg.js'; // same path as above | |
if (file_exists($script_path)) { | |
wp_enqueue_script( | |
'custom-gutenberg', | |
$script_url, | |
array('wp-data', 'wp-dom-ready', 'wp-edit-post'), |
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
// Tras rewrite en WooCommerce, Yoast seguía devolviendo canonicals antiguos | |
// Código para prevenirlo (usadlo con cuidado y comprobar los canonicals posteriormente) | |
function usm_filter_yoastcanonical( $canonical ) { | |
if (is_product()) { // sólo alteramos el canonical de los productos, no el resto | |
$canonical = get_permalink(); | |
} | |
return $canonical; | |
} | |
add_filter( 'wpseo_canonical', 'usm_filter_yoastcanonical' ); |