<?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; Wordpress</title> <atom:link href="http://eliseos.net/tag/wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://eliseos.net</link> <description>Wordpress, Diseño, jQuery and Coffee</description> <lastBuildDate>Fri, 03 Sep 2010 00:07:36 +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>Un CAPTCHA condicional para WordPress</title><link>http://eliseos.net/captcha-condicional-wordpress/</link> <comments>http://eliseos.net/captcha-condicional-wordpress/#comments</comments> <pubDate>Mon, 23 Aug 2010 21:16:37 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[comentarios]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3162</guid> <description><![CDATA[Seguramente en tu Blog tendrás algun tipo de plugin Anti-Spam, en mi caso uso desde que comencé aquí en Eliseos utilizo Akismet. Uno de los problemas de Akismet o Typad AntiSpam es que ocasiones nos suelen dar "falsos positivos]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Seguramente en tu Blog tendrás algun tipo de<strong> plugin Anti-Spam</strong>, en mi caso uso desde que comencé aquí en Eliseos utilizo Akismet. Uno de los problemas de Akismet o Typad AntiSpam es que ocasiones nos suelen dar &#8220;falsos positivos&#8221; es decir comentarios que son marcados como Spam, pero en realidad no lo son.</p><p
style="text-align: center;"><a
href="http://wordpress.org/extend/plugins/wp-conditional-captcha/"><img
class="alignnone size-full wp-image-3163" title="Conditional CAPTCHA for WordPress" src="http://eliseos.net/wp-content/uploads/2010/08/Conditional-CAPTCHA-for-WordPress.png" alt="Conditional CAPTCHA for WordPress Un CAPTCHA condicional para Wordpress" width="550" height="113" /></a></p><p><span
id="more-3162"></span></p><p
style="text-align: left;">Generalmente los que usamos Akismet tendemos a revisar los comentarios marcados como Spam de ves en cuando para ver si existen estos &#8220;falsos positivos&#8221;.</p><p
style="text-align: left;">Con el plugin <a
href="http://wordpress.org/extend/plugins/wp-conditional-captcha">Conditional CAPTCHA</a> nos evitamos de tener comentarios marcados como Spam, cuando no lo son. Como? Simple, el plugin introduce un CAPTCHA condicional, es decir:</p><ul><li>Si Akismet o TypePad AntiSpam detectan un comentario como Spam, el plugin mostrara un CATPCHA para verificar que el que comenta es humano.</li><li>Si fallan en el CAPTCHA el plugin moverá el comentario a la papelera o lo borrara (configurable).</li><li>Si se introduce el CAPTCHA correcto el comentario se aprobara o quedara en la cola de revision (configurable).</li><li>Y aquellos &#8220;comentadores&#8221; validos no verán ningún tipo de CAPTCHA.</li></ul><p
style="text-align: left;">El CAPTCHA que utiliza este plugin es uno muy simple, pero si lo queremos podes usar el famoso <a
href="http://recaptcha.net">reCAPTCHA</a> para contar con mas seguridad.</p><p
style="text-align: left;">El único requerimiento que debes cumplir es contar con <a
href="http://akismet.com">Akismet</a> o <a
href="http://antispam.typepad.com">TypePad AntiSpam</a> instalados para que el plugin pueda funcionar.</p><div
id="_mcePaste" style="position: absolute; left: -10000px; top: 33px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Akismet and TypePad AntiSpam</div> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/captcha-condicional-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Fechas mas amigables en WordPress</title><link>http://eliseos.net/fechas-amigables-wordpress/</link> <comments>http://eliseos.net/fechas-amigables-wordpress/#comments</comments> <pubDate>Fri, 20 Aug 2010 22:54:37 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[fechas]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3157</guid> <description><![CDATA[Hay una pequeña tendencia en la red a usar fechas relativas en lugar de fechas comunes para hacer nuestro sitio un poco mas user-friendly. Hace un tiempo atrás les explicaba como trabajar con fechas relativas en WordPress mediante un método muy sencill]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Hay una pequeña tendencia en la red a usar<strong> fechas relativas</strong> en lugar de fechas comunes para hacer nuestro sitio un poco mas <strong>user-friendly</strong>. Hace un tiempo atrás les explicaba como <a
title="Trabajando con fechas relativas en WordPress" href="http://eliseos.net/?p=2806">trabajar con fechas relativas en WordPress</a> mediante un método muy sencillo, pero quizás un tanto limitado.</p><p
style="text-align: center;"><a
href="http://wordpress.org/extend/plugins/date-in-a-nice-tone/"><img
class="alignnone size-full wp-image-3158" title="Fechas mas amigables en WordPress" src="http://eliseos.net/wp-content/uploads/2010/08/fechas-amigables-en-WordPress.jpg" alt="fechas amigables en WordPress Fechas mas amigables en Wordpress" width="600" height="250" /></a></p><p
style="text-align: left;">Hoy, desde WPCandy nos comentan sobre un <a
title="Fechas mas amigables en WordPress" href="http://wordpress.org/extend/plugins/date-in-a-nice-tone/">plugin para llevar esas fechas relativas</a> a un escalón más, y así tener mas control sobre las mismas.</p><p
style="text-align: left;">La idea de este plugin es cambiar el formato de la fecha original, por ejemplo:</p><div
class="wp_syntax"><div
class="code"><pre class="text" style="font-family:monospace;">Posted August 19, 2010</pre></div></div><p
style="text-align: left;">A una mas amigable:</p><div
class="wp_syntax"><div
class="code"><pre class="text" style="font-family:monospace;">Posted yesterday</pre></div></div><p
style="text-align: left;">Una vez instalado el plugin y hecho su llamado correspondiente, la fecha se reflejara según el periodo de tiempo transcurrido, por ejemplo:</p><div
class="wp_syntax"><div
class="code"><pre class="text" style="font-family:monospace;">Más de 3 años = &quot;quite a long while ago...&quot;
Más de 6 meses = &quot;about half a year ago&quot;
Más de una hora = &quot;freshly baked&quot;
Y asi en adelante.</pre></div></div><p
style="text-align: left;">Para integrarlo en nuestro Theme solo debemos reemplazar la fecha original que queremos sobre-escribir, generalmente:</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> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d M, Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p
style="text-align: left;">Por nuestra nueva fecha:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> wp_date_in_a_nice_tone<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p
style="text-align: left;">Este es un plugin básico, pero poderoso. Digo básico por que no cuenta con un panel de control, por lo cual para tener nuestras fechas en castellano, vamos a necesitar editar el plugin por nosotros mismos; pero es algo que solo nos lleva unos minutos.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/fechas-amigables-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Eliminar tags en desuso dentro de WordPress</title><link>http://eliseos.net/eliminar-tags-desuso-dentro-wordpress/</link> <comments>http://eliseos.net/eliminar-tags-desuso-dentro-wordpress/#comments</comments> <pubDate>Wed, 18 Aug 2010 03:52:49 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3151</guid> <description><![CDATA[Una de las buenas costumbres que hay que tener en cuenta para preservar y mantener en buena salud de la instalación de Wordpress es la usar la menor cantidad de Tags posibles. Para algunos personas esto es muy fácil de llevar]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Una de las buenas costumbres que hay que tener en cuenta para <strong>preservar y mantener en buena salud</strong> de la instalación de WordPress es la usar la <strong>menor cantidad de Tags</strong> posibles. Para algunos personas esto es muy fácil de llevar, pero otras personas tienden a etiquetar en cantidades astronómicas y con esto llenar la base de datos con excesivas tablas.</p><p
style="text-align: center;"><img
src="http://eliseos.net/wp-content/uploads/2010/08/borrar-tags-SQL-WordPress.jpg" alt="borrar tags SQL WordPress Eliminar tags en desuso dentro de Wordpress" title="borrar tags SQL WordPress" width="500" height="250" class="alignnone size-full wp-image-3152" /></p><p
style="text-align: left;">Con esta pequeña <strong>consulta SQL</strong> lo que va a hacer es deshacernos de todos aquellos Tags que no se encuentran en uso para contribuir al bienestar de nuestra base de datos.</p><p
style="text-align: left;">Una vez logueado en <strong>phpMyAdmin</strong> y dentro de la base de datos de nuestra instalación generaremos la siguiente consulta:</p><div
class="wp_syntax"><div
class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> a<span style="color: #66cc66;">,</span>b<span style="color: #66cc66;">,</span>c
<span style="color: #993333; font-weight: bold;">FROM</span>
	wordpress<span style="color: #66cc66;">.</span>wp_terms <span style="color: #993333; font-weight: bold;">AS</span> a
	<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> wordpress<span style="color: #66cc66;">.</span>wp_term_taxonomy <span style="color: #993333; font-weight: bold;">AS</span> c <span style="color: #993333; font-weight: bold;">ON</span> a<span style="color: #66cc66;">.</span>term_id <span style="color: #66cc66;">=</span> c<span style="color: #66cc66;">.</span>term_id
	<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> wordpress<span style="color: #66cc66;">.</span>wp_term_relationships <span style="color: #993333; font-weight: bold;">AS</span> b <span style="color: #993333; font-weight: bold;">ON</span> b<span style="color: #66cc66;">.</span>term_taxonomy_id <span style="color: #66cc66;">=</span> c<span style="color: #66cc66;">.</span>term_taxonomy_id
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #66cc66;">&#40;</span>
	c<span style="color: #66cc66;">.</span>taxonomy <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'post_tag'</span> <span style="color: #993333; font-weight: bold;">AND</span>
	c<span style="color: #66cc66;">.</span>count <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span>
	<span style="color: #66cc66;">&#41;</span></pre></div></div><p
style="text-align: left;">En el ejemplo de arriba estoy haciendo referencia a una base de datos llamada simplemente <em><code>wordpress</code></em> y cuyo prefijo de instalación es <em><code>wp_</code></em> Obviamente vas a necesitar reemplazar el nombre de la base de datos por la tuya, como así también el prefijo (en caso que lo hallas cambiado durante la instalación de WordPress).</p><p
style="text-align: left;">Como se puede apreciar <em><code>count = 0</code></em> hace referencia a Tags que no están en uso, si lo querés poder cambiar este valor a <strong>1</strong> y así eliminara Tags que solo se usaron una sola vez.</p><p
style="text-align: left;">Como siempre digo: Cuando trabajamos con este tipo de consultas SQL <strong>siempre, pero siempre realiza un backup de la base datos</strong> en caso de que algo no salga como lo esperamos.</p><p
style="text-align: left;">Visto en los <a
href="http://wordpress.org/support/topic/sql-query-to-delete-all-tags#post-1248204">foros</a> de WordPress</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/eliminar-tags-desuso-dentro-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Mostrar los post thumbnails en los feeds de WordPress</title><link>http://eliseos.net/mostrar-post-thumbnails-feeds-wordpress/</link> <comments>http://eliseos.net/mostrar-post-thumbnails-feeds-wordpress/#comments</comments> <pubDate>Mon, 16 Aug 2010 23:33:54 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[fedd]]></category> <category><![CDATA[imagenes]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3143</guid> <description><![CDATA[Como lo debes saber no es posible mostrar una <strong>imagen asociada a una entrada</strong> (post thumbnail) dentro de los feeds de Wordpress. Por lo cual es necesario recurrir a una simple función]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Como lo debes saber no es posible mostrar una <strong>imagen asociada a una entrada</strong> (post thumbnail) dentro de los <strong>feeds</strong> de WordPress. Por lo cual es necesario recurrir a una simple función para llegar a nuestro objetivo.La magia para este caso, esta potenciada por la función <a
href="http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail">get the post thumbnail</a>.</p><p><span
id="more-3143"></span></p><p
style="text-align: left;"> Como siempre, en tu archivo <em><code>functions.php</code></em> vamos a crear una nueva función con sus respectivos filtros.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> diw_post_thumbnail_feeds<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</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>has_post_thumbnail<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: #009900;">&#41;</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;">'&lt;div&gt;'</span> <span style="color: #339933;">.</span> get_the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//tamaño de la imagen a mostrar</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</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_excerpt_rss'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'diw_post_thumbnail_feeds'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content_feed'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'diw_post_thumbnail_feeds'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p
style="text-align: left;">Como se puede ver es un simple función que tomara y mostrara la primera imagen asociada a una entrada justo antes de que comience el cuerpo del post dentro los feeds. Los dos filtros a los que se hace referencia se encuentran allí para asegurarnos que que la imagen en los feed cuando marcamos en CP de WordPress si querés mostrar las <strong>entradas completas</strong> o simplemente el <strong>excerpt</strong> en los feed.</p><p
style="text-align: left;">Quizás también quieras ajustar que el tamaño de la imagen que se va a mostrar en los feeds, recordá que los valores validos son: <strong>Thumbnail, Medium o Large.</strong></p><p
style="text-align: left;">O si lo necesitas podes crear un <em><code>array</em></code> para mostrar un tamaño personalizado de la siguiente forma:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">get_the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">300</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">120</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></div></div><p
style="text-align: left;">De esta forma vamos a utilizar una imagen del orden de los 300 px X 120 px</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/mostrar-post-thumbnails-feeds-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Obtener el Width y Height de un Thumbnail en WordPress</title><link>http://eliseos.net/obtener-width-height-thumbnail-wordpress/</link> <comments>http://eliseos.net/obtener-width-height-thumbnail-wordpress/#comments</comments> <pubDate>Thu, 12 Aug 2010 22:53:30 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[hack]]></category> <category><![CDATA[imagenes]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3138</guid> <description><![CDATA[Probablemente en cierto momento de tu vida al trabajar con Wordpress vas a necesitar obtener el alto y ancho de las imágenes que subís mediante la biblioteca de medios]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Probablemente en cierto momento de tu vida al <strong>trabajar con WordPress</strong> vas a necesitar obtener el <strong>alto y ancho</strong> de las imágenes que subís mediante la <strong>biblioteca</strong> de medios. Desde la salida de WordPress 2.9 es muy simple <strong>asociar una imagen</strong> a una entrada, pero no es posible obtener el ancho y alto de la imagen de manera convencional.</p><p><span
id="more-3138"></span></p><p
style="text-align: left;">Para solucionar este problema existe una función poco conocida que nos permitirá realizar el trabajo:<a
href="http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src"> wp_get_attachment_image_src()</a> Esta función nos devolverá los <strong>valores asociados</strong> a una Thumbnail en un post.</p><p
style="text-align: left;">Donde lo necesitemos podemos incluir dentro del Loop:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$imgdata</span> <span style="color: #339933;">=</span> wp_get_attachment_image_src<span style="color: #009900;">&#40;</span> get_post_thumbnail_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$imgurl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgdata</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// url del thumbnail</span>
<span style="color: #000088;">$imgwidth</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgdata</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// width del thumbnail</span>
<span style="color: #000088;">$imgheight</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgdata</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// height del thumbnail</span></pre></div></div><p
style="text-align: left;">Como podes ver estamos devolviendo los valores para el valor thumbnail, pero si lo necesitamos podes también usar <strong>medium</strong>, <strong>large</strong> o <strong>full</strong>.</p><p
style="text-align: left;">Un ejemplo de su aplicación puede ser:</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;">$imgdata</span> <span style="color: #339933;">=</span> wp_get_attachment_image_src<span style="color: #009900;">&#40;</span> get_post_thumbnail_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$imgurl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgdata</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$imgwidth</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgdata</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$imgheight</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgdata</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</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;">$imgurl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$imgwidth</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; height=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$imgheight</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; alt=&quot;&quot; /&gt;'</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p
style="text-align: left;">De esta manera obtenemos el link a la imagen asociada al Post junto con su height y widht.</p><p
style="text-align: left;">Este método no es algo que se utilice muy a menudo, pero siempre es bueno tener estas cosas presentes para tener más opciones y entender como trabaja el Core de WordPress.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/obtener-width-height-thumbnail-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Howto: Tweet button oficial en WordPress</title><link>http://eliseos.net/howto-tweet-button-oficial-wordpress/</link> <comments>http://eliseos.net/howto-tweet-button-oficial-wordpress/#comments</comments> <pubDate>Thu, 12 Aug 2010 19:28:10 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Destacadas]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[twitter]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3129</guid> <description><![CDATA[El día hoy ha visto la luz el nuevo botón oficial de twitter para compartir links en un solo click, lo que presupone un mal día para el resto de los botones como Topsy o Tweetmeme. Si ya venís usando algún servicio de este estilo quizás quieras probar o experimentar con el nuevo botón oficial]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">El día hoy ha visto la luz el nuevo <strong>botón oficial de Twitter</strong> para compartir links en un solo click, lo que presupone un mal día para el resto de los botones como <strong>Topsy</strong> o <strong>Tweetmeme</strong>. Si ya venís usando algún servicio de este estilo quizás quieras probar o experimentar con el nuevo botón oficial. Hoy en dos simples pasos vamos a ver como integrar este nuevo servicio en nuestra instalación de WordPress sin morir en el intento.</p><p
style="text-align: center;"><img
src="http://eliseos.net/wp-content/uploads/2010/08/Tweet-Button.jpg" alt="Tweet Button Howto: Tweet button oficial en Wordpress" title="Tweet Button" width="600" height="250" class="alignnone size-full wp-image-3130" /></p><p><span
id="more-3129"></span></p><p
style="text-align: left;">Todavia es muy pronto para saber si sera el botón líder en el mercado o solo sera un competidor de Tweetmeme o Topsy. Por mi parte no me he pasado, ya que no es posible tener control sobre las URI que se acortan, Twitter usa su propio shorten service: http://t.co y escapa de nuestras manos.</p><p
style="text-align: left;">Lo primero que necesitaremos es crear una nueva función donde tendremos la configuración del botón, para esto en nuestro archivo <em>functions.php </em>vamos a insertar:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> tbutton<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</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: #000088;">$tuser</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'baires'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> get_permalink<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: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;script src=&quot;http://platform.twitter.com/widgets.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;http://twitter.com/share&quot; class=&quot;twitter-share-button&quot;
      data-url=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;
      data-via=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$tuser</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;
      data-text=&quot;Leyendo: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;
      data-related=&quot;baires: Siempre hablando de Wordpress y dise%F1o&quot;
      data-count=&quot;horizontal&quot;&gt;Tweet&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p
style="text-align: left;">Como podes observar no hay nada raro en esta función, solo los valores necesarios para que el botón pueda funcionar correctamente. Los únicos valores que necesitas editar son <em><code>$tuser</code></em> con tu usuario de Twitter y el campo <em><code>data-related</code></em> que sirve a modo de recomendar un usario cuando se comparte un link. Solo debes respetar el formato: nombre de usario seguido por dos puntos (<strong>:</strong>) y una pequeña descripción, nada más.</p><p
style="text-align: center;"><img
src="http://eliseos.net/wp-content/uploads/2010/08/Tweet-Buttons.jpg" alt="Tweet Buttons Howto: Tweet button oficial en Wordpress" title="Tweet Buttons" width="600" height="250" class="alignnone size-full wp-image-3135" /></p><p
style="text-align: left;"> Otra opción que quizás quieras modificar es el formato del botón en el campo <em><code>data-count</code></em>, en el ejemplo se utiliza un formato horizontal. Los valores que podes usar: <strong>vertical</strong>, <strong>horizontal</strong> o <strong>none</strong>.</p><p
style="text-align: left;"> Solo resta integrar el botón en nuestro Theme, para eso dentro del archivo <em><code>single.php</code></em> y donde lo creamos conveniente insertaremos:</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> tbutton<span style="color: #009900;">&#40;</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p
style="text-align: left;">Felicidades has insertado el botón oficial de Twitter en menos de un minuto</p><p
style="text-align: left;">No te olvides de leer la <a
href="http://dev.twitter.com/pages/tweet_button">documentación</a> pertinente al tema donde podrás encontrar algunos ejemplos más junto con la info no cubierta en este artículo.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/howto-tweet-button-oficial-wordpress/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>WP Show IDs: muestra el ID de cualquier elemento en WordPress</title><link>http://eliseos.net/wp-show-ids-muestra-id-cualquier-elemento-wordpress/</link> <comments>http://eliseos.net/wp-show-ids-muestra-id-cualquier-elemento-wordpress/#comments</comments> <pubDate>Thu, 12 Aug 2010 02:23:08 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[plugin]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3125</guid> <description><![CDATA[WP Show IDs es un plugin de los que se los podría catalogar como "no fundamentales" pero interesantes. Muchas veces cuando trabajamos en Wordpress necesitamos saber el ID de un post o una pagina, y la forma más simple de lograrlo es posicionando el mouse sobre la URI en nuestro Dashboard]]></description> <content:encoded><![CDATA[<p
style="text-align: left;"><a
href="http://www.primothemes.com/post/wp-show-ids-plugin/ title=">WP Show IDs</a> es un plugin de los que se los podría catalogar como &#8220;no fundamentales&#8221; pero interesantes. Muchas veces cuando trabajamos en WordPress necesitamos<strong> saber el ID de un post o una pagina</strong>, y la forma más simple de lograrlo es posicionando el mouse sobre la URI en nuestro Dashboard.</p><p
style="text-align: center;"><a
href="http://www.primothemes.com/post/wp-show-ids-plugin/"><img
class="alignnone size-full wp-image-3126" title="WP Show IDs" src="http://eliseos.net/wp-content/uploads/2010/08/WP-Show-IDs.jpg" alt="WP Show IDs WP Show IDs: muestra el ID de cualquier elemento en Wordpress" width="600" height="250" /></a></p><p><span
id="more-3125"></span></p><p
style="text-align: left;">Este plugin nos permite tener a la vista y de manera comoda y elegante el ID de <strong>casi cualquier elemento</strong> en WordPress dentro del Dashboard. Podemos ver el ID de un post, una pagina, cualquier elemento de nuestra biblioteca de medios, de un tag en particular, de una categoría, un link y un usuario.</p><p
style="text-align: left;">Como esta pensado para WordPress 3.0+ también posible ver el ID de un<strong> Post Type</strong> y las <strong>Taxonomies</strong>. Otro punto a su favor es que trabaja de manera muy eficiente e intenta no &#8220;consumir&#8221; demasiados recursos de nuestra instalación de WordPress.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/wp-show-ids-muestra-id-cualquier-elemento-wordpress/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Mostrar el caption junto con the_post_thumbnail en WordPress</title><link>http://eliseos.net/mostrar-caption-junto-the_post_thumbnail-wordpress/</link> <comments>http://eliseos.net/mostrar-caption-junto-the_post_thumbnail-wordpress/#comments</comments> <pubDate>Mon, 09 Aug 2010 22:55:33 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[imagenes]]></category> <category><![CDATA[Theme]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3121</guid> <description><![CDATA[Sin duda alguna una de las mejores funciones introducidas en Wordpress 2.9 es la posibilidad de listar un Thumbnail asociado a una entrada. Pero lamentablemente no tenemos referencias/soportes para listar un caption (captura/intro) asociado a un Thumbnail]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Sin duda alguna una de las mejores funciones introducidas en <strong>WordPress 2.9</strong> es la posibilidad de listar un <strong>Thumbnail asociado a una entrada</strong> con <em><code>the_post_thumbnail()</code></em>. Pero lamentablemente no tenemos referencias/soportes para listar un <strong>caption</strong> (captura/intro) asociado a un Thumbnail.</p><p><span
id="more-3121"></span></p><p
style="text-align: left;">En los foros de WordPress el user <strong><a
href="http://wordpress.org/support/topic/display-caption-with-the_post_thumbnail#post-1468414">AGWD101</a></strong> plantea una solución elegante para salir del paso en este dilema. Lo que vamos a hacer es crear una función que nos devuelva el caption asociado a un Thumbnail.</p><p
style="text-align: left;">Dentro de tu archivo <em><code>functions.php</code></em> introduciremos:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> the_post_thumbnail_caption<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>
&nbsp;
  <span style="color: #000088;">$thumbnail_id</span>    <span style="color: #339933;">=</span> get_post_thumbnail_id<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: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$thumbnail_image</span> <span style="color: #339933;">=</span> get_posts<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'p'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$thumbnail_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnail_image</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnail_image</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;span&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$thumbnail_image</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/span&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p
style="text-align: left;">Solo resta realizar el llamado (obviamente dentro del Loop XD)</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> the_post_thumbnail_caption<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p
style="text-align: left;">Un uso podría ser dentro de un condicional que usamos para mostrar nuestras Thumbnails:</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: #666666; font-style: italic;">//Todo esto dentro del Loop</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>has_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                the_post_thumbnail_caption<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: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span><span style="color: #339933;">.</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;template_url&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/images/img-default.png&quot; /&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://eliseos.net/mostrar-caption-junto-the_post_thumbnail-wordpress/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Promociona tus entradas antiguas con PBPP</title><link>http://eliseos.net/promociona-entradas-antiguas-pbpp/</link> <comments>http://eliseos.net/promociona-entradas-antiguas-pbpp/#comments</comments> <pubDate>Mon, 09 Aug 2010 20:36:51 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[content]]></category> <category><![CDATA[plugin]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3117</guid> <description><![CDATA[Todo los cuentan con un sitio de una edad avanzada saben que las entradas más antiguas son las que menos visitas reciben, por ende suelen pasar desapercibidas. ]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Todo los cuentan con un sitio de una edad avanzada saben que las <strong>entradas más antiguas</strong> son las que <strong>menos visitas reciben</strong>, por ende suelen pasar desapercibidas. La idea de fondo con <a
title="Powerfull Blog Post Promoter (PBPP)" href="http://wordpress.org/extend/plugins/powerfull-blog-post-promoter/">Powerfull Blog Post Promoter</a> (<strong>PBPP</strong>) es la promover esas entradas antiguas, enviándolas al principio.</p><p><span
id="more-3117"></span></p><p
style="text-align: center;"><a
href="http://wordpress.org/extend/plugins/powerfull-blog-post-promoter/"><img
class="alignnone size-full wp-image-3118" title="Powerfull Blog Post Promoter (PBPP)" src="http://eliseos.net/wp-content/uploads/2010/08/Powerfull-Blog-Post-Promoter-PBPP.jpg" alt="Powerfull Blog Post Promoter PBPP Promociona tus entradas antiguas con PBPP" width="556" height="676" /></a></p><p
style="text-align: left;">PBPP cambia el <strong>timestamp</strong> (fecha de publicación) de las entradas antiguas al azar y las ubica en las primeras posiciones, reservando las primeras posiciones para las nuevas entradas a modo de no interferir tanto con la estructura de tu sitio.</p><p
style="text-align: left;">Lo único que debes tener en cuenta es que si estas una estructura de<strong> permalinks con fechas</strong> <strong>no</strong> podrás usarlo, ya que PBPP cambia el <strong>timestamp</strong> de las entradas y te arrojaría un error 404 en tus entradas. Una buena idea seria usar una estructura de permalinks que no lleve fechas.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/promociona-entradas-antiguas-pbpp/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Embeber videos de Youtube con shortcodes en WordPress</title><link>http://eliseos.net/embeber-videos-youtube-shortcodes-wordpress/</link> <comments>http://eliseos.net/embeber-videos-youtube-shortcodes-wordpress/#comments</comments> <pubDate>Sun, 25 Jul 2010 06:02:18 +0000</pubDate> <dc:creator>Alexis</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[shortcodes]]></category><guid
isPermaLink="false">http://eliseos.net/?p=3099</guid> <description><![CDATA[Puede ser que estés al tanto o no, pero Youtube ahora nos permite utilizar un embed code mucho mas sencillo de recordar, si bien este código por ahora no aparece como un "embed oficial" es posible usarlo donde lo necesitemos]]></description> <content:encoded><![CDATA[<p
style="text-align: left;">Puede ser que estés al tanto o no, pero Youtube ahora nos permite utilizar un<strong> embed code</strong> mucho mas sencillo de recordar, si bien este código por ahora no aparece como un &#8220;embed oficial&#8221; es posible usarlo donde lo necesitemos.</p><p><span
id="more-3099"></span></p><p
style="text-align: center;"><img
src="http://eliseos.net/wp-content/uploads/2010/07/shortcodes_youtube.jpg" alt="shortcodes youtube Embeber videos de Youtube con shortcodes en Wordpress" title="shortcodes youtube wordpress" width="600" height="250" class="alignnone size-full wp-image-3112" /></p><p>Este nuevo método hace referencia a un <strong>&lt;iframe&gt;</strong> y la estructura es la siguiente:</p><div
class="wp_syntax"><div
class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">iframe</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;youtube-player&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;640&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;385&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.youtube.com/embed/VIDEO_ID&quot;</span> <span style="color: #000066;">frameborder</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">iframe</span>&gt;</span></pre></div></div><p
style="text-align: left;">Como lo podes ver es muy sencillo de recordar, a diferencia del método anterior. Ahora, no seria bueno incluir este nuevo método con un Shortcode dentro de WordPress? Mi respuesta es sí! Y es muy sencillo.</p><p
style="text-align: left;">En tu archivo <em><code>functions.php</code></em> crearemos un nuevo shortcode con la siguiente estructura:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//youtube embed</span>
<span style="color: #000000; font-weight: bold;">function</span> youtube_embed<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: #666666; font-style: italic;">//definimos nuestro shortcode</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;">'width'</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;">//ancho por defecto</span>
        <span style="color: #0000ff;">'height'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'385'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//largo por defecto</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// ID del video</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 class=&quot;youtube-player&quot; type=&quot;text/html&quot; 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; src=&quot;http://www.youtube.com/embed/'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; frameborder=&quot;0&quot;&gt;
&lt;/iframe&gt;'</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// el output</span>
<span style="color: #009900;">&#125;</span>
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'youtube'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'youtube_embed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//sintaxis</span>
<span style="color: #666666; font-style: italic;">//youtube embed</span></pre></div></div><p
style="text-align: left;">Aqui lo importante es definir el ancho y largo de nuestro video para agilizar luego al momento de llamar al <strong>Shortcode</strong>. Si no se especifica un ancho y largo predeterminado el Shortcode por defecto toma los ya especificados, en nuestro caso 640&#215;385.</p><p
style="text-align: left;">Ahora, cada vez que necesitemos mostrar un video de Youtube, solo debemos saber el <strong>ID</strong> del video, ese conjunto de <strong>11 caracteres</strong> al final de <em><code>URI</code></em> del video.</p><p
style="text-align: left;">Un método rápido de escritura seria,</p><div
class="wp_syntax"><div
class="code"><pre class="text" style="font-family:monospace;">[youtube id=&quot;BfYR6EH_9qg&quot;]</pre></div></div><p
style="text-align: left;">Donde se toma el ancho y largo por defecto antes especificado.</p><p
style="text-align: left;">Si queremos un ancho y largo especifico, podemos escribir:</p><div
class="wp_syntax"><div
class="code"><pre class="text" style="font-family:monospace;">[youtube id=&quot;BfYR6EH_9qg&quot; height=&quot;300&quot; width=&quot;600&quot;]</pre></div></div><p
style="text-align: left;">Como siempre: sencillo y rápido.</p> ]]></content:encoded> <wfw:commentRss>http://eliseos.net/embeber-videos-youtube-shortcodes-wordpress/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
<!-- Served from: eliseos.net @ 2010-09-03 15:47:15 by W3 Total Cache -->