Skip to content

Instantly share code, notes, and snippets.

View sibaberpollo's full-sized avatar

José Pino sibaberpollo

View GitHub Profile
SELECT
'mysql:archive' AS 'source',
articles.id AS 'article.legacy_id',
articles.post_name AS 'article.slug',
articles.post_title AS 'article.title',
articles.post_excerpt AS 'article.excerpt',
articles.post_content AS 'article.body',
NULL AS 'article.main_tag',
articles.post_date_gmt AS 'article.created_at',
articles.post_modified_gmt AS 'article.updated_at',
@sibaberpollo
sibaberpollo / www2.sql
Last active October 17, 2019 19:54
Contenido antiguo
SELECT articles.id AS 'article.legacy_id',
articles.post_author AS 'author.legacy_id',
authors.user_email AS 'author.email',
authors.user_nicename AS 'author.username',
authors.display_name AS 'author.full_name',
articles.guid AS 'article.url',
articles.post_name AS 'article.slug',
articles.post_title AS 'article.title',
articles.post_excerpt AS 'article.excerpt',
articles.post_content AS 'article.body',
@sibaberpollo
sibaberpollo / reordenar.php
Last active June 29, 2018 11:19
En el function.php
<?php
add_filter( "woocommerce_checkout_fields", "reordering_checkout_fields", 15, 1 );
function reordering_checkout_fields( $fields ) {
## ---- 1. REORDERING BILLING FIELDS ---- ##
// Set the order of the fields
$billing_order = array(
'billing_rut',
function enviacorreo($datos){
$para = $datos['mail'];
$copiaMail = "";
$enviarCopia;
if ($datos['tipomens']===1)
{
$asunto = "Registro de falla producto Somela";
$mensaje = "Hemos recibido tu Solicitud de Garantía. Ésta será analizada por el área técnica y se te indicará las acciones a seguir. Número de registro: <b>".$datos['RegistroN']."</b>";
$copiaMail = "postvtasomela.chile@electrolux.com";
$enviarCopia = true;
<style>
.banner {
background: url(<?php
if(is_home() || is_front_page()) { ?>
../images/4.jpg) <?php }else { ?>
$urlFeaturred = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') );
echo $urlFeaturred;
<?php } ?> no-repeat 0px 0px;
}
</style>
@sibaberpollo
sibaberpollo / functions.php
Created April 12, 2016 17:41
reescribir todo el html de un wordpress
function callback($buffer) {
// modify buffer here, and then return the updated code
return $buffer;
}
function buffer_start() { ob_start("callback"); }
function buffer_end() { ob_end_flush(); }
add_action('wp_loaded', 'buffer_start');
@sibaberpollo
sibaberpollo / test.js
Last active April 12, 2016 15:05
buscar y remplazar
En el html es este:
<div id='div-gpt-ad-1424458191588-0' style=' width: 940px; margin: 0 auto; position relative; '>
<script type='text/javascript'>
googletag.display('div-gpt-ad-1427394218176-0');
</script>
</div>
y debo cambiarlo por:
@sibaberpollo
sibaberpollo / functions.php
Last active April 6, 2016 15:46
en la función save de wordpress, mueve la imagen destacada a un directorio y agrega un texto
<?php
function save_id_to_file($post_id){
//use your file creation/save function here
header ("Content-type: image/jpeg");
$path = "C:\TEMP";
$imageName = $path."\\meme-".$post_id.".png";
$imageNameFeat = $path."\\meme-".$post_id."-feat.png";
$elTitulo = get_field('conduccion');
$('.panel-body section').each(function(index) {
if (index > 1) {
$(".panel-body").ready(function(){
$("<button>Contáctanos</button>").insertBefore("section");
});
}
});
<?php
add_filter( 'auto_update_plugin', '__return_false' );
add_filter( 'auto_update_theme', '__return_false' );
/* Remover version de Woprdpress */
add_action('init', 'myoverride', 100);
function myoverride() {
remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}