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
/** | |
* Allow uploads for SVG files. | |
*/ | |
function cc_mime_types($mimes) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter('upload_mimes', 'cc_mime_types'); | |
/** |
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
// Display 24 products per page. Goes in functions.php | |
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 ); |
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
Show hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme", | |
"font_options": | |
[ | |
"gray_antialias", | |
"subpixel_antialias" | |
], | |
"font_size": 13, |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://site-to-change.com', 'http://127.0.0.1/site-changed') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = REPLACE (guid, 'http://site-to-change.com', 'http://127.0.0.1/site-changed'); | |
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://site-to-change.com', 'http://127.0.0.1/site-changed'); | |
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://site-to-change.com', 'http://127.0.0.1/site-changed'); |
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
// Añado otra taxonomía, esta vez no es jerárquica, como las etiquetas. | |
$labels = array( | |
'name' => _x( 'Escritores', 'taxonomy general name' ), | |
'singular_name' => _x( 'Escritor', 'taxonomy singular name' ), | |
'search_items' => __( 'Buscar Escritores' ), | |
'popular_items' => __( 'Escritores populares' ), | |
'all_items' => __( 'Todos los escritores' ), | |
'parent_item' => null, | |
'parent_item_colon' => null, | |
'edit_item' => __( 'Editar Escritor' ), |
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
/** Función que elimina todo rastro de fechas en los artículos */ | |
function bf_remove_dates() { | |
add_filter('the_time', '__return_false'); | |
add_filter('get_the_time', '__return_false'); | |
add_filter('the_modified_time', '__return_false'); | |
add_filter('get_the_modified_time', '__return_false'); | |
add_filter('the_date', '__return_false'); | |
add_filter('get_the_date', '__return_false'); | |
add_filter('the_modified_date', '__return_false'); | |
add_filter('get_the_modified_date', '__return_false'); |
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_action('wp', 'bf_remove_dates'); |
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
/** Función que elimina todo rastro de fechas en los artículos */ | |
function bf_remove_dates() { | |
if( is_singular('libros') ){ | |
add_filter('the_time', '__return_false'); | |
add_filter('get_the_time', '__return_false'); | |
add_filter('the_modified_time', '__return_false'); | |
add_filter('get_the_modified_time', '__return_false'); | |
add_filter('the_date', '__return_false'); | |
add_filter('get_the_date', '__return_false'); | |
add_filter('the_modified_date', '__return_false'); |
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_action( 'pre_insert_term', function ( $term, $taxonomy ) | |
{ | |
return ( 'tutaxonomia' === $taxonomy && !current_user_can( 'manage_options' ) ) | |
? new WP_Error( 'term_addition_blocked', __( 'No puedes añadir términos a esta taxonomía.' ) ) | |
: $term; | |
}, 0, 2 ); |
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
/* | |
* FacetWP Pagination | |
* You should print it with `echo facetwp_display( 'pager' );` if you prefer that to shortcode method | |
*/ | |
function bf_custom_paginator_facetwp( $output, $params ) { | |
$output = ''; | |
$page = (int) $params['page']; | |
$total_pages = (int) $params['total_pages']; |
OlderNewer