Skip to content

Instantly share code, notes, and snippets.

View ximosa's full-sized avatar

Joaquin Saez ximosa

View GitHub Profile
@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;
@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 / dynamik
Created January 24, 2014 17:08
dynamik
<div class="home-featured"><div class="wrap"><?php echo do_shortcode( '[home_featured_left]' ); ?><?php echo do_shortcode( '[home_featured_right]' ); ?></div></div>
----------css..............
.wrap {
max-width: 1140px;
margin: 0 auto;
overflow: hidden;
}
.home-featured {
background-attachment: fixed;
@ximosa
ximosa / Custom Post Types y Taxonomías mas formulario
Last active January 3, 2016 22:08
Custom Post Types y Taxonomías en WordPress
/**
* Genesis custom
*crear dos paginas achivos archive-tax_lien.php
*otra de single-tax_lien.php
*/
add_action( 'init', 'create_custom_post_type' );
function create_custom_post_type() {
@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