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 | |
| if (isset($accessToken)) { | |
| try { | |
| // Returns a `Facebook\FacebookResponse` object | |
| $response = $fb->get('/me?fields=id,name,email,first_name,last_name', $accessToken)->getDecodedBody(); | |
| } catch(Facebook\Exceptions\FacebookResponseException $e) { | |
| echo 'Graph returned an error: ' . $e->getMessage(); | |
| unset($_SESSION['facebook_access_token']); | |
| exit; |
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 20160309 | |
| # | |
| # 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
| #/bin/bash | |
| chown www-data:www-data -R * # Deja que Apache sea el propietario | |
| find . -type d -exec chmod 755 {} \; | |
| find . -type f -exec chmod 644 {} \; | |
| #.htaccess (config de ejecución de apache) | |
| chmod -v 666 .htaccess | |
| # Permisos especificos |
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 | |
| $query_base = "https://www.youtube.com/embed/{ID_DEL_VIDEO}?"; | |
| $query_data = array( | |
| 'enablejsapi'=> 1, | |
| 'origin'=> (is_single()) ? get_the_permalink() : site_url(), | |
| 'version'=> 3, | |
| 'hl'=> "es", | |
| 'rel'=> 0, | |
| 'showinfo'=> 0, |
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( 'body_class', 'cc_removerClasesBody', 10, 2 ); | |
| if (!class_exists('cc_removerClasesBody')) { | |
| function cc_removerClasesBody( $wp_classes, $extra_classes ) { | |
| # Coloca las Clases que quieres eliminar | |
| $clases_a_eliminar = array('tag','otraClaseCSS'); | |
| # Verify if exist the class of WP in $clases_a_eliminar |
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 | |
| if ( have_posts() ) : | |
| while ( have_posts() ) : | |
| the_post(); | |
| $post_the_title = get_the_title(); | |
| if (strlen($post_the_title) > 55) { | |
| $post_the_title = substr($post_the_title, 0, 55) . '...'; | |
| } | |
| ?> |
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
| du -hs * | sort -nr | head -200 |
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 | |
| if ( ! function_exists( 'bkc_meta_views_shares' ) ) { | |
| function bkc_meta_views_shares( $post_id = null ) { | |
| $post_meta = []; | |
| static $posts_metas = []; | |
| /* | |
| * Si el ID no fue pasado, se asigna automaticamente el del post | |
| * que esta siendo leido en el momento donde se uso la funcion. | |
| */ |
OlderNewer