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 | |
/** | |
* Remove the ver query argument from the source path | |
* @param $src Script loader source path. | |
* | |
* @return string | |
*/ | |
function tm_remove_query_string_version( $src ){ | |
return remove_query_arg( 'ver', $src ); |
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
## EXPIRES CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" | |
ExpiresByType text/css "access 1 month" | |
ExpiresByType text/html "access 1 month" | |
ExpiresByType application/pdf "access 1 month" |
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
normal-wp-search-query.sql - takes < 1 second | |
tablepress-query-hook.sql - takes around 4 seconds | |
tablepress-thrive-hooks.sql - takes between 20 and 30 seconds and froze the server | |
The site is hosted in his own server. | |
Server spects | |
4 CPUS | |
8G Ram | |
80 GB SSD HD |
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 | |
/** | |
* include the TCB saved meta into query search fields | |
* | |
* wordpress actually allows inserting post META fields in the search query, | |
* but it will always build the clauses with AND (between post content and post meta) e.g.: | |
* WHERE (posts.title LIKE '%xx%' OR posts.post_content) AND (postsmeta.meta_key = 'tve_save_post' AND postsmeta.meta_value LIKE '%xx%') | |
* | |
* - we cannot use this, so we hook into the final pieces of the built SQL query - we need a solution like this: |
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
/* | |
# Time: 2016-11-17T01:05:06.879587Z | |
# User@Host: -----[-----] @ localhost [127.0.0.1] Id: 1150 | |
# Query_time: 60.799160 Lock_time: 0.000680 Rows_sent: 14 Rows_examined: 209299 | |
*/ | |
SELECT SQL_CALC_FOUND_ROWS wp_s3bgzgx9jq_posts.ID FROM wp_s3bgzgx9jq_posts LEFT JOIN wp_s3bgzgx9jq_postmeta | |
AS tve_pm ON (wp_s3bgzgx9jq_posts.ID = tve_pm.post_id) WHERE 1=1 | |
AND ( ((tve_pm.meta_key = 'tve_save_post') AND (tve_pm.meta_value LIKE '%Box%')) | |
OR ((tve_pm.meta_key = 'tve_save_post') AND (tve_pm.meta_value LIKE '%mods%')) |
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
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); | |
function enqueue_parent_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); | |
} |
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
/* | |
Theme Name: Twenty Sixteen Child | |
Theme URI: http://tusitio.com/twentysixteen-child/ | |
Description: My tema hijo basado en Twenty Sixteen | |
Author: Enrique Chavez | |
Author URI: https://enriquechavez.co | |
Template: twentysixteen | |
Version: 1.0.0 | |
Tags: black, green, white, light, dark, two-columns, three-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready, responsive-layout, infinite-scroll, post-slider, design, food, journal, magazine, news, photography, portfolio, clean, contemporary, dark, elegant, modern, professional, sophisticated | |
Text Domain: twenty-sixteen-child |
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 | |
$content = get_the_content(); // O de donde obtengas tu contenido https://codex.wordpress.org/Function_Reference/get_the_content. | |
$tagless = wp_strip_all_tags( $content ); // Remueve las etiquetas HTML https://codex.wordpress.org/Function_Reference/wp_strip_all_tags | |
$short = substr( $tagless, 0, 100); // "Corta" el texto del 0 al 100 http://php.net/manual/en/function.substr.php | |
echo $short; |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
root /var/www/laravel/public; | |
index index.php index.html index.htm; | |
server_name localhost; | |
location ~ \.php$ { |
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
mysql> select * from currencies; | |
+----+-----------------------------+-------------+---------------+ | |
| id | name | google_code | official_code | | |
+----+-----------------------------+-------------+---------------+ | |
| 1 | Argentine Peso | ARS | ARS | | |
| 2 | Australian Dollar | A$ | AUD | | |
| 3 | Bolivian Boliviano | BOB | BOB | | |
| 4 | Brazilian Real | R$ | BRL | | |
| 5 | British Pound | £ | GBP | | |
| 6 | Brunei Dollar | BND | BND | |