<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Eliseos.net &#187; hack</title> <atom:link href="http://eliseos.net/tag/hack/feed/" rel="self" type="application/rss+xml" /><link>http://eliseos.net</link> <description>Wordpress, Diseño, jQuery and Coffee</description> <lastBuildDate>Thu, 11 Mar 2010 22:55:55 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Esquinas redondeadas en todos los navegadores</title><link>http://eliseos.net/css/esquinas-redondeadas-todos-navegadores/</link> <comments>http://eliseos.net/css/esquinas-redondeadas-todos-navegadores/#comments</comments> <pubDate>Thu, 11 Mar 2010 22:55:55 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[CSS3]]></category> <category><![CDATA[hack]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2756</guid> <description><![CDATA[Una de los mayores problemas a la hora de diseñar teniendo en la mira a los standards de estos tiempos es hacer que Internet Explorer se comporte como un navegador decente y nos permita sacar el máximo provecho a las nuevas tecnologías]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Una de los mayores problemas a la hora de diseñar teniendo en la mira a los standards de estos tiempos es hacer que Internet Explorer se comporte como un navegador decente y nos permita sacar el máximo provecho a las nuevas tecnologías, para este caso <strong>CSS3</strong> y sus nuevas posibilidades. Hoy vamos a ver como lograr redondear esquinas en todos los navegadores, incluyendo a Internet Explorer 8/7 y la tan temida versión 6.</p><p><span
id="more-2756"></span></p><p
style="text-align: left;">Para reazlizar esta tarea, solo vamos a necesitar un pequeño archivo HTC, que en definitiva es un archivo que guarda un conjunto de <em>scripts</em> exclusivamente para Internet Explorer. La forma correcta de lograr esquinas redondeadas en todos los navegadores sera:</p><h2>Cross Browser border-radius</h2><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.mi_selector</span> <span style="color: #00AA00;">&#123;</span> 
  -moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>  <span style="color: #808080; font-style: italic;">/* Firefox */</span>
  -webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Safari y Crhome */</span>
  -khtml-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Browser en Linux */</span>
  border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* CSS3  Standard */</span>
  behavior<span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>border-radius<span style="color: #6666ff;">.htc</span> standards <span style="color: #808080; font-style: italic;">/* Internet explorer */</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><p
style="text-align: left;">Solo necesitas una copia del archivo <em><code>border-radius.htc</code></em> que se puede obtener <a
title="Rounded corner HTML elements using CSS3" href="http://code.google.com/p/curved-corner/">aquí</a>, y colocarlo en tu carpeta donde guardas la hoja de estilo. Con una simple linea extra en tu <strong>CSS</strong> ahora tendrás esquinas redondeadas en todos los navegadores.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/css/esquinas-redondeadas-todos-navegadores/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Crear un the_excerpt() personalizado en Wordpress</title><link>http://eliseos.net/wordpress/crear-the_excerpt-personalizado-wordpress/</link> <comments>http://eliseos.net/wordpress/crear-the_excerpt-personalizado-wordpress/#comments</comments> <pubDate>Fri, 26 Feb 2010 01:42:14 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[hack]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2706</guid> <description><![CDATA[Trabajando en Wordpress, una de las cuestiones que mas resulta tediosa es no contar con las herramientas necesario para poder personalizar el the_excerpt() ese tag que solo nos muestra un adelanto de la entrada en el front]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Trabajando en Wordpress, una de las cosas que mas resulta tedioso es no contar con las herramientas necesarias para poder personalizar <em><code>the_excerpt()</code></em> ese tag que solo nos muestra un adelanto de la entrada en el front, el archivo y en las categorías. Siempre tenemos que recurrir a pequeños hacks, para personalizarlo a nuestro gusto.</p><p
style="text-align: left;">Hoy leyendo en <a
href="http://www.milienzo.com/2007/09/02/improving-wordpress-the_excerpt-template-tag/">Milienzo</a> encontré un hack que me pareció correcto de reproducir ya que podemos lograr una personalización del tag <em><code>the_excerpt()</code></em> casi perfecta.</p><h2>Problemas con the_excerpt()</h2><p
style="text-align: left;">Solo se muestran las primeras 55 palabras, no dándonos la posibilidad de acomodar ese numero. En cuanto el al formato, el tag limpia todos los tags HTML, por lo que no se muestran imágenes ni formato en los párrafos. Y por ultimo, en cuanto hablamos de javascript tenemos un gran problema ya que <em><code>the_excerpt()</code></em> no lo filtra, lo que trae como aparejado posibles problemas en el formato y vulnerabilidades.</p><p
style="text-align: left;">Lo que en milienzo nos plantean, es crear una nueva función para solucionar los problemas mencionados mas arriba.</p><h2>Comencemos</h2><p
style="text-align: left;">En tu archivo <em><code>functions.php</code></em> introduciremos esta nueva función</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> improved_trim_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$text</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> get_the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">']]&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">']]&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@&lt;script[^&gt;]*?&gt;.*?&lt;/script&gt;@si'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$excerpt_length</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$words</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excerpt_length</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span> <span style="color: #000088;">$excerpt_length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			ray_push<span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[...]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p
style="text-align: left;">Al no estar &#8220;tocando&#8221; no los archivos del core de Wordpress podremos reproducir esta función en todos los Themes que necesitemos.</p><h2>Controlar el tamaño en the_excerpt()</h2><p
style="text-align: left;">En lugar de mostrar solo las primeras 55 palabras, digamos que solo mostraremos las primeras 80.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$excerpt_length</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span></pre></div></div><p
style="text-align: left;">Para aumentar o disminuir las palabras, solo resta reemplazar el <strong>80</strong> por el numero deseado.</p><h2>Incluir tags HTML</h2><p
style="text-align: left;">Como lo mencione antes, al no poder contar con la posibilidad de mostrar dichos tags podemos encontrar problemas a la hora de dar formato</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p
style="text-align: left;">En este caso estamos incluyendo siempre el tag <em><code>&lt;p&gt;</code></em> Si lo necesitáramos podríamos también incluir el tag <em><code>&lt;img&gt;</code></em> o los que deseemos. Solo tenemos que mencionar los tags uno al lado de otro.</p><h2>Remover todo el código javascript que no necesitamos</h2><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@&lt;script[^&gt;]*?&gt;.*?&lt;/script&gt;@si'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p
style="text-align: left;">Esta simple linea, nos ahorrara futuros dolores de cabeza.</p><p
style="text-align: left;">Ahora solo resta indicar nuestro nuevo filtro, otra vez dentro de <em><code>functions.php</code></em> insertamos:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">remove_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_trim_excerpt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'improved_trim_excerpt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><h2>Implementación</h2><p
style="text-align: left;">Solo nos queda integrar este nuevo <em><code>the_excerpt()</code></em> mejorado dentro de nuestro Theme reemplazando el <em><code>the_excerpt()</code></em> original por nuestro el nuevo y flamante tag:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> improved_trim_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></div></div><p
style="text-align: left;">Como lo notaras el hack es bastante flexible y podemos lograr buenos resultado con pocas lineas de código.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/crear-the_excerpt-personalizado-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Cross-Browser Videos con HTML5</title><link>http://eliseos.net/general/cross-browser-videos-html5/</link> <comments>http://eliseos.net/general/cross-browser-videos-html5/#comments</comments> <pubDate>Fri, 12 Feb 2010 00:53:28 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[hack]]></category> <category><![CDATA[html5]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2660</guid> <description><![CDATA[Video for Everybody es una suerte de hacks en HTML para embeber videos tomando ventajas del tag video (en HTML5) pero con una serie de peculiaridades]]></description> <content:encoded><![CDATA[<p
style="text-align: left;"><a
title="Video for Everybody" href="http://camendesign.com/code/video_for_everybody">Video for Everybody</a> es una suerte de hacks en HTML para embeber videos tomando ventajas del tag <em><code>video</code></em> (en <em><code>HTML5</code></em>) pero con una serie de peculiaridades.</p><p
style="text-align: center;"><a
href="http://camendesign.com/code/video_for_everybody"><img
class="alignnone size-full wp-image-2661" title="Video for Everybody" src="http://eliseos.net/wp-content/uploads/2010/02/Video-for-Everybody.jpg" alt="Video for Everybody Cross Browser Videos con HTML5" width="500" height="250" /></a></p><p><span
id="more-2660"></span></p><p
style="text-align: left;">Hay muchos navegadores que no soportan el tag <em><code>&lt;video&gt;</code></em> por lo que ese código automáticamente al detectar dicho navegador sirve una alternativa para la visualización, sin necesidad de javascript; por ende los videos serán visibles en los lectores de feed, Iphone y demás.</p><p
style="text-align: left;">Al cargar la pagina el código sirve automáticamente el video vía el tag <em><code>&lt;video&gt;</code></em> (<em><code>OGV</code></em>), por lo que no se necesitan plugins adicionales en el navegador. Si el navegador no soporta el tag; se sirve el video como Quicktime (<em><code>MP4</code></em>), que se visualiza correctamente en Iphone. Ahora si Quicktime no esta instalado se servira el video utilizando flash (<em><code>FLV</code></em>) pudiendo embeber cualquier archivo en Flash, incluso videos desde Youtube.</p><p
style="text-align: left;">Y como si fuero poco, si el navegador no soportara ni el tag <em><code>&lt;video&gt;</code></em> ni tuviera instalado Quicktime ni Flash, se sirve una imagen estática para que el usuario pueda descargar el video y reproducirlo localmente.</p><p
style="text-align: left;">Las ventajas son evidentes al usar este código, estamos logrando que nuestro video siempre se resproduzca y el usario tenga acceso a él. La única desventaja es que debemos proporcionar el video en cada formato posible: <em><code>OGG, MP4, Flash</code></em> etc.</p><p
style="text-align: left;">En la pagina encontraras el <a
title="Video for Everybody" href="http://camendesign.com/code/video_for_everybody">código completo</a> fuertemente comentado para que le saques el jugo a tus videos.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/general/cross-browser-videos-html5/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>CSS personalizado para cada entrada en Wordpress</title><link>http://eliseos.net/wordpress/css-personalizado-entrada-wordpress/</link> <comments>http://eliseos.net/wordpress/css-personalizado-entrada-wordpress/#comments</comments> <pubDate>Mon, 08 Feb 2010 22:39:41 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[hack]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2655</guid> <description><![CDATA[Como todos lo sabemos Wordpress es muy flexible y con él podemos hacer casi cualquier cosa, en esta ocasión en particular vamos a crear un Box para poder estilizar nuestras entradas por medio de ]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Como todos lo sabemos Wordpress es muy flexible y con él podemos hacer casi cualquier cosa, en esta ocasión en particular vamos a crear un Box para poder estilizar nuestras entradas por medio de CSS.</p><p
style="text-align: center;"><img
class="alignnone size-full wp-image-2656" title="Custom CSS en Wordpess" src="http://eliseos.net/wp-content/uploads/2010/02/Custom-CSS.jpg" alt="Custom CSS CSS personalizado para cada entrada en Wordpress" width="500" height="250" /></p><p><span
id="more-2655"></span></p><p
style="text-align: left;">Como lo sabrás cada Theme tiene su propia hoja de estilos que es lo que le formato en definitiva. Si necesitáramos personalizar nuestras entradas, tendríamos que editar la hoja de estilos del Theme; cosa que puede ser algo molesto si solo necesitamos personalizar una entrada en concreto.</p><p
style="text-align: left;">Con esta pequeña función, estaremos añadiendo un Box para que la hora de crear un Post o Pagina podamos insertar un estilo para cada entrada/pagina en concreto.</p><p
style="text-align: left;">Por medio de filtros y acciones esta función insertar en el header de nuestro Theme, el estilo que le hayamos aplicados. Solo tenes que cerciorarte que Theme cuente con <em><code>wp_head();</code></em> dentro del Header.</p><h2>Uso</h2><p
style="text-align: left;">En tu archivo <em><code>functions.php</code></em> inserta lo siguiente:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;">//Custom CSS </span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_css_hooks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'save_post'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'save_custom_css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'insert_custom_css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> custom_css_hooks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'custom_css'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Custom CSS'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_css_input'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'normal'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'high'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	add_meta_box<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'custom_css'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Custom CSS'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_css_input'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'normal'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'high'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> custom_css_input<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;input type=&quot;hidden&quot; name=&quot;custom_css_noncename&quot; id=&quot;custom_css_noncename&quot; value=&quot;'</span><span style="color: #339933;">.</span>wp_create_nonce<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'custom-css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;textarea name=&quot;custom_css&quot; id=&quot;custom_css&quot; rows=&quot;5&quot; cols=&quot;30&quot; style=&quot;width:100%;&quot;&gt;'</span><span style="color: #339933;">.</span>get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'_custom_css'</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/textarea&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> save_custom_css<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_id</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>wp_verify_nonce<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'custom_css_noncename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom-css'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$post_id</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DOING_AUTOSAVE'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> DOING_AUTOSAVE<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$post_id</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$custom_css</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'custom_css'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	update_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'_custom_css'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$custom_css</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> insert_custom_css<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;style type=&quot;text/css&quot;&gt;'</span><span style="color: #339933;">.</span>get_post_meta<span style="color: #009900;">&#40;</span>get_the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'_custom_css'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/style&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
		rewind_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//End Custom CSS</span></pre></div></div><p
style="text-align: left;">Ahora cada vez que escribas una entrada/pagina encontraras este box para insertar tus estilos:</p><p
style="text-align: center;"><img
class="alignnone size-full wp-image-2657" title="Custom CSS Box en Wordpress" src="http://eliseos.net/wp-content/uploads/2010/02/Custom-CSS-Box.jpg" alt="Custom CSS Box CSS personalizado para cada entrada en Wordpress" width="500" height="250" /></p><p
style="text-align: left;">Como lo veras esta función es bastante flexible por lo sera posible adaptarla, para por ejemplo también poder incluir <em><code>scripts</code></em> en nuestro Header.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/css-personalizado-entrada-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>21 shortcuts utiles para escribir tus entradas</title><link>http://eliseos.net/wordpress/21-shortcuts-utiles-escribir-entradas/</link> <comments>http://eliseos.net/wordpress/21-shortcuts-utiles-escribir-entradas/#comments</comments> <pubDate>Thu, 04 Feb 2010 21:09:53 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[hack]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2636</guid> <description><![CDATA[Si sos de los que tiende a escribir entradas largas, habrás notado que se pierde una cantidad de tiempo a la hora de darle formato al texto, negrita, subrayado, etc]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Si sos de los que tiende a escribir entradas largas, habrás notado que se pierde una cantidad de tiempo a la hora de darle formato al texto, negrita, subrayado, etc.</p><p>El editor de Wordpress es muy poderoso, y dispone de una serie de shortcuts (atajos) para darle formato al texto.<br
/> <span
id="more-2636"></span></p><p
style="text-align: left;">Estos son los 21 shortcuts necesarios para llevar tu productividad al máximo:</p><ul><li><h4>Negrita: Alt+SHIFT+b</h4></li><li><h4>Cursiva: Alt+SHIFT+i</h4></li><li><h4>Link: Alt+SHIFT+a</h4></li><li><h4>Blockquote: Alt+SHIFT+q</h4></li><li><h4>Codigo: Alt+SHIFT+c</h4></li><li><h4>Leer mas: Alt+SHIFT+t</h4></li><li><h4>Lista desordenada (ul): Alt+SHIFT+u</h4></li><li><h4>Lista ordenada (ol): Alt+SHIFT+o</h4></li><li><h4>Item de lista (li): Alt+SHIFT+l</h4></li><li><h4>Editor avanzado: Alt+SHIFT+v</h4></li><li><h4>Publicar entrada: Alt+SHIFT+p</h4></li><li><h4>ins: Alt+SHIFT+s</h4></li><li><h4>del: Alt+SHIFT+d</h4></li><li><h4>Deshacer cita/sangria: Alt+SHIFT+w</h4></li><li><h4>Deshacer: Alt+SHIFT+u</h4></li><li><h4>Rehacer: Alt+SHIFT+y</h4></li><li><h4>Editar en HTML: Alt+SHIFT+e</h4></li><li><h4>Alinear a la izquierda: Alt+SHIFT+f</h4></li><li><h4>Alinear al centro: Alt+SHIFT+c</h4></li><li><h4>Alinear a la derecha: Alt+SHIFT+r</h4></li><li><h4>Ctrl+[numero] para cambiar entre distinto tamaño de header en el texto seleccionado</h4></li></ul><p
style="text-align: left;">Visto en <a
title="21 Most Useful Time Saving WordPress Shortcuts" href="http://www.wpbeginner.com/beginners-guide/21-most-useful-time-saving-wordpress-shortcuts/">Wpbeginner</a></p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/21-shortcuts-utiles-escribir-entradas/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Obtener los tags para una categoria en Wordpress</title><link>http://eliseos.net/wordpress/obtener-tags-una-categoria-wordpress/</link> <comments>http://eliseos.net/wordpress/obtener-tags-una-categoria-wordpress/#comments</comments> <pubDate>Tue, 02 Feb 2010 23:42:58 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[hack]]></category> <category><![CDATA[tags]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2631</guid> <description><![CDATA[Quizás alguna vez te hayas preguntado como obtener los tags de solo una(s) categoría(s) pero no hayas dando con el código necesarios. Obtener solo los tags para X categoría dada]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Quizás alguna vez te hayas preguntado como obtener los tags de solo una(s) categoría(s) pero no hayas dando con el código necesario. Obtener solo los tags para <em>X</em> categoría dada, puede ser una buena idea si contamos con Blog bastante popular y necesitamos centrar la atención en puntos concretos, en este casos los tags.</p><p
style="text-align: center;"><img
src="http://eliseos.net/wp-content/uploads/2010/02/wordpres-tags-por-categorias.jpg" alt="wordpres tags por categorias Obtener los tags para una categoria en Wordpress" title="wordpres tags por categorias" width="500" height="250" class="alignnone size-full wp-image-2632" /></p><p
style="text-align: left;">Tal ves te estés preguntando que diferencia puede haber en nombrar los tags de este forma y de la forma que comúnmente se utiliza. Bueno, supongamos que cuentas con Blog donde cuentas con estas categorías y tags relacionados:</p><ul><li>A) Informática <strong>Tags&gt;</strong> Mac Os, Windows, Linux</li><li>B) Música <strong>Tags&gt;</strong> Rock, Pop, Clásica</li><li>C) Películas <strong>Tags&gt;</strong> Retro, Drama, Acción</li></ul><p
style="text-align: left;">Si quisiera crear en mi barra lateral un pequeño rincón donde lo titulo el mes de la música, una buena idea seria mostrar las ultimas entradas y los últimos tags. Mis ultimas entradas se muestran con un <em><code>query_post</code></em>, pero si invoco a mis tags, estarían incluyendo; no solo a Rock, Pop y Clásica; sino también a todos los demás, como por ejemplo, Drama, Linux, etc.</p><p
style="text-align: left;">Con esta pequeña receta podremos incluir los últimos 10 tags asignados dentro de una categoría o categorías, con unas simples lineas.</p><h2>Abre tu archivo functions.php</h2><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">function</span> get_category_tags<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$tags</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span>
	<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;
		SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link
		FROM
			wp_posts as p1
			LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID
			LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id
			LEFT JOIN wp_terms as terms1 ON t1.term_id = terms1.term_id,
&nbsp;
			wp_posts as p2
			LEFT JOIN wp_term_relationships as r2 ON p2.ID = r2.object_ID
			LEFT JOIN wp_term_taxonomy as t2 ON r2.term_taxonomy_id = t2.term_taxonomy_id
			LEFT JOIN wp_terms as terms2 ON t2.term_id = terms2.term_id
		WHERE
			t1.taxonomy = 'category' AND p1.post_status = 'publish' AND terms1.term_id IN (&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'categories'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;) AND
			t2.taxonomy = 'post_tag' AND p2.post_status = 'publish'
			AND p1.ID = p2.ID
		ORDER by tag_name
		LIMIT 10 
	&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tags</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$tags</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tag_link</span> <span style="color: #339933;">=</span> get_tag_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tag_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$count</span><span style="color: #339933;">++;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$tags</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p
style="text-align: left;">Como podrás ver <em><code>LIMIT 10</code></em> es lo que nos permite tomar control de la cantidad de tags a mostrar, para este ejemplo solo serán 10.</p><h2>Integrando en tu plantilla</h2><p
style="text-align: left;">Donde necesites mostrar los tags, solo introduce este lineas, y lograras mostrar los últimos 10 tags en un lista desordenada.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'categories'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'3,40'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// id de la(s) categoria(s) que queremos hacer referencia</span>
<span style="color: #000088;">$tags</span> <span style="color: #339933;">=</span> get_category_tags<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tags</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$tag-&gt;tag_link</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">$tag-&gt;tag_name</span>&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/php&gt;</pre></div></div><p
style="text-align: left;">Como lo veraz el <em><code>array</code></em> es simple de adaptar a tus necesidades, por lo que podrás darle el formato que mas te convenga.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/obtener-tags-una-categoria-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Remover el atributo nofollow dentro de tus entradas</title><link>http://eliseos.net/wordpress/remover-atributo-nofollow-dentro-entradas/</link> <comments>http://eliseos.net/wordpress/remover-atributo-nofollow-dentro-entradas/#comments</comments> <pubDate>Mon, 01 Feb 2010 23:13:46 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[hack]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2628</guid> <description><![CDATA[Seguramente en algún momento habrás utilizado el atributo nofollow en el contenido de tus entradas, siguiendo algún consejo para sumar en ]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Seguramente en algún momento habrás utilizado el atributo <em><code>nofollow</code></em> en el contenido de tus entradas, siguiendo algún consejo para sumar en SEO.</p><p>Wordpress por defecto no utiliza este atributo, pero varios plugins lo hacen; o quizás fuiste tu mismo el que agrego el nofollow manualmente en tus artículos.</p><p>Si por algún motivo ya no deseas que ese atributo este presente en el contenido de tus entradas, con esta simple función no desharemos del atributo nofollow.</p><h2>Eliminar atributo nofollow dentro de las entradas</h2><p>Dentro del archivo <em><code>functions.php</code></em> inserta estas lineas:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> remove_nofollow<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_ireplace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' rel=&quot;nofollow&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$string</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_nofollow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Esta pequeña función revisara tus entradas y se deshará del atributo automáticamente.</p><h2>Eliminar atributo nofollow dentro de las entradas y comentarios</h2><p>Si también deseas deshacerte del nofollow en tu contenido y en tus comentarios, solo necesitas añadir estas lineas en tu <em><code>functions.php</code></em></p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> remove_nofollow<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_ireplace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' rel=&quot;nofollow&quot;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$string</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_nofollow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_nofollow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Visto en <a
title="WordPress Tip: Remove nofollow Attributes from Post Content" href="http://digwp.com/2010/02/remove-nofollow-attributes-from-post-content/">Digging into Wordpesss</a></p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/remover-atributo-nofollow-dentro-entradas/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Mostrar mapas de Google con Shortcodes en Wordpress</title><link>http://eliseos.net/wordpress/mostrar-mapas-google-shortcodes-wordpress/</link> <comments>http://eliseos.net/wordpress/mostrar-mapas-google-shortcodes-wordpress/#comments</comments> <pubDate>Thu, 21 Jan 2010 03:49:36 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[google]]></category> <category><![CDATA[hack]]></category> <category><![CDATA[shortcodes]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2594</guid> <description><![CDATA[Desde Diggin into Wordpress nos acercan este simple hack con el que podremos insertar Mapas desde Google Maps con un simple Shortcode]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Desde <a
title="Google Maps Shortcode" href="http://digwp.com/2010/01/google-maps-shortcode/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+DiggingIntoWordpress+%28Digging+Into+WordPress%29">Diggin into Wordpress</a> nos acercan este simple hack con el que podremos insertar Mapas desde Google Maps con un simple Shortcode.</p><p>Ya he hablado <a
title="Shortcodes en wordpress" href="http://eliseos.net/tag/shortcodes/">varias veces</a> de las ventajas y posibles usos que le podemos dar a los Shortcodes en Wordpress, en el día de hoy añadiremos una mas.</p><p><span
id="more-2594"></span></p><p
style="text-align: left;">La idea de fondo es siempre utilizar el core de Wordpress y no intentar de caer en un plugin para realizar simples tareas, en este caso insertar un Mapa desde Google.</p><p
style="text-align: left;">Como primer paso necesitaremos abrir nuestro archivo <em><code>functions.php</code></em> y añadir las siguientes lineas:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> fn_googleMaps<span style="color: #009900;">&#40;</span><span style="color: #000088;">$atts</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span>shortcode_atts<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">&quot;width&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'640'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//largo por defecto</span>
      <span style="color: #0000ff;">&quot;height&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'480'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//ancho por defecto</span>
      <span style="color: #0000ff;">&quot;src&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span> <span style="color: #666666; font-style: italic;">// url del mapa</span>
   <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$atts</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;iframe width=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$width</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; height=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$height</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$src</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;amp;output=embed&quot;&gt;&lt;/iframe&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;googlemap&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;fn_googleMaps&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p
style="text-align: left;">Cada vez que necesitemos mostrar un mapa seguiremos este formato:</p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">[googlemap width=&quot;200&quot; height=&quot;200&quot; src=&quot;URL&quot;]</pre></div></div><p
style="text-align: left;">Donde <em><code>widh</code></em> y <em><code>height</code></em> representan el largo y el ancho del mapa y <em><code>URL</code></em> es la direccion al mapa que queremos mostrar. Esta dirección se obtiene desde Google Map cuando pulsamos para obtener nuestro link a la direccion (mapa) a la que vamos a hacer referencia.</p><p
style="text-align: center;"><img
class="alignnone size-full wp-image-2595" title="Mostrar Google Maps con Shortcodes en Wordpress" src="http://eliseos.net/wp-content/uploads/2010/01/Google-Maps-Shortcodes-Wordpress.jpg" alt="Google Maps Shortcodes Wordpress Mostrar mapas de Google con Shortcodes en Wordpress" width="500" height="250" /></p><p
style="text-align: left;">Por ultimo, hay que notar que si no usamos los valores <em><code>widh</code></em> y <em><code>height</code></em> en nuestro Shortcode se tomaron los valores por defecto en nuestra función, cosa que nos pude ahorrar un poco de tiempo a la hora de escribir.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/mostrar-mapas-google-shortcodes-wordpress/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Ultimos comentarios con Gravatar en Wordpress</title><link>http://eliseos.net/wordpress/ultimos-comentarios-gravatar-wordpress/</link> <comments>http://eliseos.net/wordpress/ultimos-comentarios-gravatar-wordpress/#comments</comments> <pubDate>Wed, 13 Jan 2010 21:22:19 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[hack]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2577</guid> <description><![CDATA[Hoy leyendo en WpRecipes me tome con una linda receta que mostraba como mostrar los últimos &#8220;XX&#8221; comentarios junto con el gravatar correspondiente. Pero sentía que era una receta a medias, ya que se podía obtener mucho mas ]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Hoy leyendo en <a
title="Display most recent comments with Gravatar" href="http://www.wprecipes.com/display-most-recent-comments-with-gravatar">WpRecipes</a> me tome con una linda receta que mostraba como mostrar los últimos &#8220;XX&#8221; comentarios junto con el gravatar correspondiente. Pero sentía que era una receta a medias, ya que se podía obtener mucho mas con unas lineas extras de código.</p><p
style="text-align: center;"><img
class="alignnone size-full wp-image-2578" title="Wordpress ultimos comentarios con gravatar" src="http://eliseos.net/wp-content/uploads/2010/01/wordpress_ultimos-comentarios_gravatar.jpg" alt="wordpress ultimos comentarios gravatar Ultimos comentarios con Gravatar en Wordpress" width="500" height="250" /></p><p><span
id="more-2577"></span></p><p
style="text-align: left;">Con esta receta mejorada ahora podremos ajustar el tamaño del gravatar, mostrar y controlar los caracteres del comentario y mostrar solo comentarios, excluyendo Pingbacks y Trackbacks.</p><p
style="text-align: left;">Donde necesites que se muestren los últimos comentarios solo introduce esta porción de código.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$comments</span> <span style="color: #339933;">=</span> get_comments<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'status=approve&amp;number=5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//solo ultimos 5 comentarios aprobados , exlcluir Pingbacks &amp; Trackbacks</span>
<span style="color: #000088;">$img_w</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'80'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//tamaño de mi gravatar</span>
<span style="color: #000088;">$comment_lenth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'150'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//cantidad de caracteres a mostrar antes de cortar el comentario</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;ul&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$comment_content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$comment_excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mb_substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_content</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$comment_lenth</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; [...]&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$permalink</span> <span style="color: #339933;">=</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;#comment-&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_ID</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$permalink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; title=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' | '</span> <span style="color: #339933;">.</span>
            get_the_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_post_ID</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;gravatar&quot;&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> get_avatar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author_email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$img_w</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/a&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p class=&quot;comment_author&quot;&gt;Autor: '</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/a&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;span class=&quot;comment_text&quot;&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; &lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$permalink</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> title=<span style="color: #000099; font-weight: bold;">\&quot;</span>Ver todo el comentario<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment_excerpt</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/span&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/ul&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p
style="text-align: left;">Lo que nos devolverá un Output como el siguiente:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">         <span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>
                    <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;gravatar&quot;</span><span style="color: #339933;">&gt;</span>
                        <span style="color: #339933;">&lt;</span>img alt<span style="color: #339933;">=</span><span style="color: #0000ff;">''</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://www.gravatar.com/avatar/9b3068f17206b81cdde75e85d50885cb?s=80&amp;amp;d=http%3A%2F%2Feliseos.net%2Fwp-content%2Fthemes%2FEliseosV2%2Fimages%2Favatar.png%3Fs%3D80&amp;amp;r=G'</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'avatar avatar-80 photo'</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">'80'</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">'80'</span> <span style="color: #339933;">/&gt;</span>
                    <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
                    <span style="color: #339933;">&lt;</span>p <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment_author&quot;</span><span style="color: #339933;">&gt;</span>Autor<span style="color: #339933;">:</span> Alexis<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>span <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment_text&quot;</span><span style="color: #339933;">&gt;</span>Estas usando los campos personalizados o custom fields ? <span style="color: #009900;">&#91;</span><span style="color: #339933;">...</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
         <span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span></pre></div></div><p
style="text-align: left;">Ahora solo te resta darle estilo a través de CSS.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/ultimos-comentarios-gravatar-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Auto rellenar los campos de comentarios en Wordpress</title><link>http://eliseos.net/wordpress/auto-rellenar-campos-comentarios-wordpress/</link> <comments>http://eliseos.net/wordpress/auto-rellenar-campos-comentarios-wordpress/#comments</comments> <pubDate>Tue, 29 Dec 2009 23:14:22 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[hack]]></category><guid
isPermaLink="false">http://eliseos.net/?p=2537</guid> <description><![CDATA[Una de las cosas que que siempre intento predicar es hacer sentir al lector lo mas cómodo posible, para que vuelva al Blog. Hoy leyendo en uno de los blogs que siempre recomiendo seguir: Digging into Wordpress nos ]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Una de las cosas que que siempre intento predicar es hacer sentir al lector lo mas cómodo posible, para que vuelva al Blog. Hoy leyendo en uno de los blogs que siempre recomiendo seguir: <a
title="Digging into Wordpress" href="http://digwp.com/2009/12/gravatar-and-auto-fill/">Digging into Wordpress</a> nos acercaron una receta/idea para seguir con esta modalidad: Rellenar los campos de los comentarios de manera automática.</p><p
style="text-align: left;">Por cada comenario que un lector deja en el blog se almacenan datos en las cookies, se guardan en sus computadoras y luego a través de Wordpress podemos acceder a ellos. Los valores mas importantes y a los que luego haremos referencia son:</p><ol><li><h3>$comment_author</h3></p></li><li><h3>$comment_author_email</h3></p></li><li><h3>$comment_author_url</h3></p></li></ol><p
style="text-align: left;">Nuestro objetivo sera modificar nuestro archivo <em><code>comments.php</code></em> para que luego de cada comentario dejado, Wordpress recuerde automáticamente estos datos y se lo muestre al usuario, así este no tiene la necesidad de volver a introducirlos.</p><p
style="text-align: left;">Como lo mencione mas arriba Wordpress almacena esta información por nosotros, solo resta hacer el llamado y mostrar nuestro output:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author_email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><h2>Editando nuestro archivo comments.php</h2><p
style="text-align: left;">Solo necesitamos modificar los 3 campos donde se introduce el Nombre, el Sitio Web y el E-mail. Para eso solo modificamos los 3 valores antes mencionados en nuestros <em><code>input</code></em>:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">&lt;div&gt;
  &lt;label for=&quot;author&quot;&gt;Nombre*&lt;/label&gt;
  &lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; tabindex=&quot;1&quot; /&gt;			
&lt;/div&gt;	
&nbsp;
&lt;div&gt;
  &lt;label for=&quot;email&quot;&gt;E-mail*&lt;/label&gt;
  &lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author_email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; tabindex=&quot;2&quot; /&gt;
&lt;/div&gt;
&nbsp;
&lt;div&gt;
  &lt;label for=&quot;url&quot;&gt;Sitio Web&lt;/label&gt;
  &lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; tabindex=&quot;3&quot; /&gt;
&lt;/div&gt;</pre></div></div><p
style="text-align: left;">Cada ves que un usuario vuelva a comentar, Wordpress le recordara sus datos. Fantástico!</p><h2>Mostrar el Gravatar</h2><p>Como un extra si se quiere, también somos capaces de devolver el Gravatar del usuario para mostrarlo donde necesitemos. La <em><code>URL</code></em> de Gavatar esta compuesta por el siguiente formato:</p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">http://www.gravatar.com/avatar/MD5-HASH-OF-EMAIL</pre></div></div><p
style="text-align: left;">Así que solo necesitamos devolverla dentro de <em><code>img</code></em> y estaremos listos</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author_email</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
    <span style="color: #000088;">$gravatar_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.gravatar.com/avatar/'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_author_email</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'?s=32'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$gravatar_link</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; alt=&quot;&quot; /&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p
style="text-align: left;">Estos pequeños trucos nos ayudan a interactuar cada ves mas con el usuario y hacerlo sentir mas a gusto.</p><p
style="text-align: left;">Articulo visto en <a
title="Digging into Wordpress" href="http://digwp.com/2009/12/gravatar-and-auto-fill/">Digging into Wordpress</a></p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wordpress/auto-rellenar-campos-comentarios-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: wp06.secure-dns.net @ 2010-03-12 02:24:59 by W3 Total Cache -->