Skip to content

Instantly share code, notes, and snippets.

View Page-Carbajal's full-sized avatar

Page Carbajal Page-Carbajal

View GitHub Profile
@Page-Carbajal
Page-Carbajal / jquery-injection.js
Created May 14, 2018 15:00
Injecting jQuery on Runtime
// Force jQuery Injection
(function($d){
if( 'undefined' === typeof jQuery ){
var head = document.getElementsByTagName("head")[0];
var customScript = document.createElement("script");
customScript.src = scriptSource;
customScript.onload = function(){
if( jQuery ){
/******** Start writing you jQuery code here ************/
@Page-Carbajal
Page-Carbajal / templates.md
Last active November 26, 2018 16:28
Page Templates

Tres tipos diferentes de templates

1. Preconfigurado

<?php
get_header();

while( have_posts() ){
   the_post();
@Page-Carbajal
Page-Carbajal / update.md
Last active January 3, 2019 13:44
UPDATE SELECT

Import values from a related table

UPDATE wp_posts AS posts,
	(SELECT post_id, meta_value FROM wp_postmeta 
		WHERE meta_key = 'wpcf-p-desc') AS meta
	SET posts.post_content = meta.meta_value
WHERE posts.ID = meta.post_id
AND posts.post_content = ''
;