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 | |
| /** | |
| * Mostrar / Ocultar Admin Bar | |
| * | |
| * Según el Codex, basta retornar el valor 'false' en la función 'show_admin_bar' para ocultar | |
| * la barra de administración. Sin embargo, esta implementación parece que no funciona correctamente. | |
| * | |
| */ | |
| function remove_admin_bar($show_admin_bar) | |
| { |
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
| # ----------------------------------------------------------------- | |
| # .gitignore for WordPress @salcode | |
| # ver 20180808 | |
| # | |
| # From the root of your project run | |
| # curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
| # to download this file | |
| # | |
| # By default all files are ignored. You'll need to whitelist | |
| # any mu-plugins, plugins, or themes you want to include in the repo. |
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
| 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 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
| /** | |
| * rem with fallback to px | |
| * | |
| * Use px as unit and only within a property. | |
| * Default root font-size is standard 16px. | |
| * | |
| * Example: | |
| * p { | |
| * font-size: rem(18px); | |
| * box-shadow: 0 0 rem(7px) #000; |
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_filter( 'the_content', 'remove_empty_p', 20, 1 ); | |
| function remove_empty_p( $content ){ | |
| // clean up p tags around block elements | |
| $content = preg_replace( array( | |
| '#<p>\s*<(div|aside|section|article|header|footer)#', | |
| '#</(div|aside|section|article|header|footer)>\s*</p>#', | |
| '#</(div|aside|section|article|header|footer)>\s*<br ?/?>#', | |
| '#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#', | |
| '#<p>\s*</(div|aside|section|article|header|footer)#', |
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
| stylus: | |
| compress: true | |
| path: ./path/to/styl |