jueves, 19 de mayo de 2011

Blog de diseño en papel

Muchos ejemplos de diseño gráfico editorial en este blog.

http://graficamente-grafica.blogspot.com/

sábado, 14 de mayo de 2011

Extraer solo la primera imagen de un post en Wordpress

En principio esto no sería complicado sabiendo que hay muchos plugins que lo hacen, y en otras muchas webs te explican como hacerlo desde el propio código con funciones.
Pero claro, estos plugins o explicaciones están fundamentados en el uso de la herramienta media del propio wordPress.

Extraer imagen de un post en Wordpress

Pasos

1.- Abre functions.php en el directorio de tu plantilla. Si el archivo no existe créalo. Copia este código:


Código PHP:
<?php // Función para extraer imagen de artículo. Autor: metacortex. 13/12/2008 - 4:45
// http://www.forosdelweb.com
// Licencia GNU/GPL. Puedes remover estos créditos si quieres.
function mi_imagen($tamano = '') {
  if ( 
$images = get_children( array (
    
'post_parent'    => get_the_ID(),
    
'post_type'      => 'attachment',
    
'numberposts'    => 1,
    
'post_mime_type' => 'image'
   
)));
  {
    foreach( 
$images as $image ) {
      if(
$tamano == 'mini') {
      
$imagen = wp_get_attachment_image( $image->ID, 'thumbnail' );
      } if(
$tamano == 'medio') {
      
$imagen = wp_get_attachment_image( $image->ID, 'medium' );
      } if(
$tamano == 'grande') {
      
$imagen = wp_get_attachment_image( $image->ID, 'full' );
      }
      echo 
$imagen;
    }
  }
}
?>

jueves, 5 de mayo de 2011

Averiguar la tipografia de una web

Follow chengyinliu on Twitter
← Back to Chengyin's main page

What is this for?

What is the easiest way to find out the fonts used in a webpage?
Firebug or Webkit Inspector? No, that's too complicated. It should be just a click away.
Hence I wrote this tool, with which you can easily get font information about the text you are hovering on.
A screenshot showing WhatFont in action. 
 

How to use it?