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
/** | |
* 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
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
add_action( 'init', 'bf_register_custom_post_type' ); | |
/** | |
* Registro un custom post type 'libro'. | |
* | |
* @link http://codex.wordpress.org/Function_Reference/register_post_type | |
*/ | |
function bf_register_custom_post_type() { | |
/* Añado las etiquetas que aparecerán en el escritorio de WordPress */ | |
$labels = array( | |
'name' => _x( 'Libros', 'post type general name', 'text-domain' ), |
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
// Lo enganchamos en la acción init y llamamos a la función create_book_taxonomies() cuando arranque | |
add_action( 'init', 'create_book_taxonomies', 0 ); | |
// Creamos dos taxonomías, género y autor para el custom post type "libro" | |
function create_book_taxonomies() { | |
/* Configuramos las etiquetas que mostraremos en el escritorio de WordPress */ | |
$labels = array( | |
'name' => _x( 'Géneros', 'taxonomy general name' ), | |
'singular_name' => _x( 'Género', 'taxonomy singular name' ), | |
'search_items' => __( 'Buscar por Género' ), |
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'); |
OlderNewer