Skip to content

Instantly share code, notes, and snippets.

View ximosa's full-sized avatar

Joaquin Saez ximosa

View GitHub Profile
@ximosa
ximosa / pagina-hija
Last active February 15, 2017 23:23
Crear listado de páginas hijas en genesis
<?php
// Template Name: Pages-hijas
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_loop');
function custom_loop() {
global $post;
$pageid = $post->ID;
@ximosa
ximosa / codigo
Last active December 1, 2016 09:24
Listado paginas hijas
// función para poner código corto [wpb_childpages].
function wpb_list_child_pages() {
global $post;
if ( is_page() && $post->post_parent )
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );
else
@ximosa
ximosa / loguin .php
Last active November 30, 2016 19:09
PAGINA SOLO PARA USUARIOS
<?php
/**
* Template Name: Loguin-wp
*/
get_header(); ?>
<div class="tu clase css">
<div class="tu clase css">
<main class="tu clase css">
<?php if ( is_user_logged_in() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
@ximosa
ximosa / Collapse.js
Created May 1, 2016 22:53
Colapse abrir y cerrar contenidos
+function(t){"use strict";function e(e){var a,s=e.attr("data-target")||(a=e.attr("href"))&&a.replace(/.*(?=#[^\s]+$)/,"");return t(s)}function a(e){return this.each(function(){var a=t(this),i=a.data("bs.collapse"),n=t.extend({},s.DEFAULTS,a.data(),"object"==typeof e&&e);!i&&n.toggle&&/show|hide/.test(e)&&(n.toggle=!1),i||a.data("bs.collapse",i=new s(this,n)),"string"==typeof e&&i[e]()})}var s=function(e,a){this.$element=t(e),this.options=t.extend({},s.DEFAULTS,a),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};s.VERSION="3.3.6",s.TRANSITION_DURATION=350,s.DEFAULTS={toggle:!0},s.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},s.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,i=this.$parent&&this.
@ximosa
ximosa / json-ld.php
Last active January 29, 2016 12:06
Agregar el marcado (JSON-LD) ,estructurado en schema.org.-http://www.webgae.com/agregar-el-marcado-json-ld-estructurado-en-schema-org/
<?php
function get_post_data() {
global $post;
return $post;
}
// para cualquier página
$payload["@context"] = "http://schema.org/";
@ximosa
ximosa / front-page.php
Last active March 11, 2018 17:22
Crear pagina de incio en genesis con widgets
<?php
/**
* crear pagina de inicio.
*
* @author webgae
* @front-page.php
*/
//* Eliminar breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
//* Eliminar Genesis loop
@ximosa
ximosa / 1-STYLE.CSS
Last active August 29, 2015 14:28
Códigos básicos para crear temas en WordPress.
/* Theme Name: Mini
Theme URI: http://lapaginademitema.com
Description: Explicación sobre mi tema
Version: 1
Author: Tu nombre
Author URI: http://mipaginaweb.com
Tags: doscolumnas, azul, arial
*/
@ximosa
ximosa / fracmentos genesis
Created August 21, 2015 16:20
Fragmentos de código para construir temas infantiles en Génesis.
Header
Custom Header Support
/** Add custom header support */
add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 100, 'textcolor' => '444', 'admin_header_callback' => 'minimum_admin_style' ) );
Remove Header
/** Remove Header */
remove_action( 'genesis_header', 'genesis_do_header' );
Remove Title & Description
@ximosa
ximosa / gist:c07866e7f24f8110a38f
Created August 21, 2015 15:29
Cómo cargar estilos en Génesis
//* Añadir nuevo css
add_action( 'wp_enqueue_scripts', 'custom_load_custom_style_sheet' );
function custom_load_custom_style_sheet() {
wp_enqueue_style( 'custom-stylesheet', CHILD_URL . '/custom.css', array(), PARENT_THEME_VERSION );
}
//* Sustituir css por defecto por otro
add_filter( 'stylesheet_uri', 'custom_replace_default_style_sheet', 10, 2 );
function custom_replace_default_style_sheet() {
return CHILD_URL . '/custom.css';
@ximosa
ximosa / css botones compartir de genesis plugin
Created August 21, 2015 15:12
Configure los botones de compartir de Genesis Simple Share.
/* Genesis Simple Share
--------------------------------------------- */
.content a.count,
.content a.count:hover,
.content a.share,
.content a.share:hover {
border: none;
}