Skip to content

Instantly share code, notes, and snippets.

View ximosa's full-sized avatar

Joaquin Saez ximosa

View GitHub Profile
@ximosa
ximosa / codigo php y css
Created December 16, 2020 16:54
Mostrar el stock en la lista de productos de WooCommerce
add_action( 'woocommerce_after_shop_loop_item_title', 'dcms_show_stock_list_products' );
function dcms_show_stock_list_products() {
global $product;
if ( $product->is_in_stock() ) {
echo '<div class="stock" >' . $product->get_stock_quantity() . ' en stock</div>';
} else {
echo '<div class="out-stock" >No hay stock</div>';
}
}
@ximosa
ximosa / blogger.js
Created November 29, 2020 04:16
condicionales blogger
Para aplicar etiquetas, debe tener un poco de conocimiento de HTML, observe que básicamente comienza con una etiqueta con el atributo "cond" y termina con una etiqueta de cierre. Entre estas etiquetas, el contenido (html, estilo, script, widgets ...) solo aparecerán o seguirán ciertas condiciones.
Por ejemplo, en el siguiente código:
<b:if cond='your condition'>
<style>...css code...</style>
<script>...javascript code...</script>
</b:if>
Parte 1. Etiquetas de condición
1. Página de inicio
<b:if cond='data:view.isHomepage'>
'use strict';
// Shortcuts to DOM Elements.
var signInButton = document.getElementById('sign-in-button');
var signOutButton = document.getElementById('sign-out-button');
var splashPage = document.getElementById('page-splash');
var recentPostsSection = document.getElementById('recent-posts-list');
var userPostsSection = document.getElementById('user-posts-list');
var topUserPostsSection = document.getElementById('top-user-posts-list');
@ximosa
ximosa / contacto.html
Created December 29, 2019 14:21
integrar google forms
<form action="https://docs.google.com/forms/u/0/d/e/1FAIpQLSfwzUmXZaoxSWzlz7HMPP9Bm0jDu0QchCF3HposYvjFnV3gfA/formResponse" target="_self" method="POST" id="mG61Hd">
<div class="form-row shadow-lg p-3 mb-5 bg-white rounded">
<label class="font-weight-light" for="formGroupExampleInput">Su nombre</label>
<input class="form-control"type="text" aria-describedby="i.desc.1898404042 i.err.1898404042" name="entry.1391857090" placeholder="Díganos su nombre">
<label class="font-weight-light" for="exampleFormControlInput1">Dirección de correo electrónico
</label>
<input class="form-control" type="email" jsname="YPqjbf" autocomplete="email" tabindex="0" aria-label="Tu dirección de correo electrónico" name="emailAddress" value="" required="" dir="auto" data-initial-dir="auto" data-initial-value="" placeholder="Dirección de correo electrónico">
<label class="font-weight-light" for="exampleFormControlTextarea1">Mensaje</label>
<textarea class="form-control s" jsaction="input:Lg5SV;ti6hGc:XMgOHc;rcuQ6b:WYd;" required="" name=
@ximosa
ximosa / datos.js
Created December 19, 2019 17:47
ARCHIVO DE LOGIN FIREBASE
// Aqui sus datos de firebase
var firebaseConfig = {
apiKey: "tu key",
authDomain: "tuproyecto.firebaseapp.com",
databaseURL: "https://tuproyecto.firebaseio.com",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: ""
@ximosa
ximosa / blogger.xml
Last active December 19, 2019 17:51
Plantilla blogger + firebase
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta charset='utf-8'/>
<meta content='width=device-width, initial-scale=1, shrink-to-fit=no' name='viewport'/>
<b:include data='blog' name='all-head-content'/>
<title><data:blog.pageTitle/></title>
<link crossorigin='anonymous' href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css' integrity='sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh' rel='stylesheet'/>
<link href='https://cdnjs.cloudflare.com/ajax/libs/plyr/3.5.6/plyr.css' rel='stylesheet'/>
@ximosa
ximosa / index.html
Created December 4, 2019 10:06
Lector de feed completo. Blogger
<link href='https://fonts.googleapis.com/css?family=Abel' rel='stylesheet' type='text/css'>
<div id="total"></div>
<div class="loading"></div>
<div id="feed"></div>
@ximosa
ximosa / onboarding.php
Created October 30, 2019 20:36
Revolution Pro Onboarding
<?php
/**
* Revolution Pro.
*
* Onboarding config to load plugins and homepage content on theme activation.
*
* Visit `/wp-admin/admin.php?page=genesis-getting-started` to trigger import.
*
* @package Revolution Pro
* @author StudioPress
@ximosa
ximosa / shorcodes
Created December 5, 2017 17:24
shorcodes drive
Como saber la id de tu carpeta
https://drive.google.com/drive/folders/12e7s6DPEOneGu56tyyu
https://drive.google.com/drive/folders/esto es la id de tu carpeta
Como poner carpeta de videos
[useyourdrive dir="ide de tu carpeta" mode="video" viewrole="administrator|editor|author|contributor|subscriber|guest"
downloadrole="administrator|editor|author|contributor|subscriber|guest" mediaextensions="mp4"]
@ximosa
ximosa / functions.php
Created March 5, 2017 18:51
Ver fecha de actualización en wordpress
function wpb_last_updated_date( $content ) {
$u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 86400) {
$updated_date = get_the_modified_time('F jS, Y');
$updated_time = get_the_modified_time('h:i a');
$custom_content .= '<p class="actualizado">Actualizado en '. $updated_date . ' at '. $updated_time .'</p>';
}
$custom_content .= $content;