Skip to content

Instantly share code, notes, and snippets.

View jpcontrerasv's full-sized avatar
馃彔
Working from home

Juan Pablo Contreras Vald茅s jpcontrerasv

馃彔
Working from home
View GitHub Profile
@jpcontrerasv
jpcontrerasv / Sacar la URL del Thumbnail.php
Created July 30, 2014 14:53
Sacar la URL del Thumbnail
Dentro del loop:
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' ); $url = $thumb['0']; ?>
la URL:
<?=$url?>
gzip file.txt
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="700" style="margin:0 auto 0 auto; border-collapse:collapse; background:#edeef0; border:1px solid #000;" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="700" height="98"><table width="700" border="0" cellspacing="0" cellpadding="0">
.tagItem {display: table;}
.tagItem a{height: 80px; display: table-cell; vertical-align: middle;}
<?php wp_reset_postdata(); ?>
//When to use: best used after custom or multiple loops created with WP_Query.
<?php wp_reset_query(); ?>
//When to use: best used after a query_posts loop to reset things after a custom query.
<?php rewind_posts(); ?>
@jpcontrerasv
jpcontrerasv / CSS > Media Queries.css
Created July 30, 2014 14:53
CSS > Media Queries
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@jpcontrerasv
jpcontrerasv / HT > Redirecci贸n con WWW a sin WWW.txt
Created July 30, 2014 14:53
HT > Redirecci贸n con WWW a sin WWW
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
@jpcontrerasv
jpcontrerasv / PHP > Session Cookie.php
Created July 30, 2014 14:53
PHP > Session Cookie
<?php $var_destacados = new WP_Query('post_type=destacados&showposts=6'); while ($var_destacados->have_posts()) : $var_destacados->the_post(); ?>
<?php endwhile; ?>
/*con taxonomias*/
<?php
query_posts( array(
'post_type' => 'video',
'taxonomy' => 'programas',
@jpcontrerasv
jpcontrerasv / WP > Register post type.php
Created July 30, 2014 14:53
WP > Register post type
register_post_type('banner_mini', array(
'labels' => array(
'name' => __('Banners') ,
'singular_name' => __('Banner') ,
'add_new' => _x('Agregar nuevo', 'banner_mini') ,
'add_new_item' => __('Agregar nuevo banner') ,
) ,
'public' => true,
'has_archive' => false,
'show_ui' => true,