<?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>WordPress Hacks &#187; Hacks</title>
	<atom:link href="http://wordpress-hacks.com/cat/hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://wordpress-hacks.com</link>
	<description>Tips y consejos de WordPress en español</description>
	<lastBuildDate>Wed, 25 Jan 2012 11:59:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Listar todas las tags en una lista</title>
		<link>http://wordpress-hacks.com/listar-todas-las-tags-en-una-lista.php</link>
		<comments>http://wordpress-hacks.com/listar-todas-las-tags-en-una-lista.php#comments</comments>
		<pubDate>Tue, 23 Nov 2010 23:03:47 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[get_tags]]></category>
		<category><![CDATA[get_tag_link]]></category>
		<category><![CDATA[get_the_tag_list]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=649</guid>
		<description><![CDATA[Valga la redundancia... Necesitaba crear una lista de tags que muestre todas verticalmente como lo hace la función wp_list_cats() con las categorías, pero WordPress no me ayudaba mucho. Es cierto que está la función de las nube de tags, pero no me servía. La función get_the_tag_list() muestra solo las tags [...]]]></description>
			<content:encoded><![CDATA[<p>Valga la redundancia...</p>
<p>Necesitaba crear una <strong>lista de tags</strong> que muestre todas verticalmente como lo hace la función wp_list_cats() con las categorías, pero WordPress no me ayudaba mucho.<br />
Es cierto que está la función de las nube de tags, pero no me servía. La función <strong>get_the_tag_list()</strong> muestra solo las tags de un current post, por lo que tampoco servía.</p>
<p>Googleando <a href="http://wordpress.org/support/topic/list-all-tags">encontré esto</a> y fué la solución, el código lo modifiqué para que quede un poco mejor, acá se los dejo:</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;ul&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$tags</span> = get_tags<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tags</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tags</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$tag</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;li&gt;&lt;a href=&quot;'</span> . get_tag_link<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tag</span>-&gt;<span style="color:#006600;">term_id</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&quot; title=&quot;'</span> . <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">"$tag-&gt;name"</span> <span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$tag</span>-&gt;<span style="color:#006600;">name</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&quot; '</span> . <span style="color:#FF0000;">'&gt;'</span> . <span style="color:#0000FF;">$tag</span>-&gt;<span style="color:#006600;">name</span>.<span style="color:#FF0000;">'&lt;/a&gt; &lt;/li&gt;'</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/ul&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y que las tag lists estén con ustedes...</p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/listar-todas-las-tags-en-una-lista.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crear una lista con artículos al azar</title>
		<link>http://wordpress-hacks.com/crear-lista-random-posts.php</link>
		<comments>http://wordpress-hacks.com/crear-lista-random-posts.php#comments</comments>
		<pubDate>Wed, 17 Nov 2010 21:19:24 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=638</guid>
		<description><![CDATA[Nota: Leer este comentario antes de implementar el código Si necesitás crear una lista de artículos al azar tenés suerte, ya que es algo bastante fácil de hacer. Para hacer esto, abris el archivo donde querés mostrar la lista y agregás el código que está más abajo, yo por ejempo [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><span style="color: #ff0000;">Nota:<a href="http://wordpress-hacks.com/crear-lista-random-posts.php#comment-3509"> Leer este comentario</a> antes de implementar el código</span></p></blockquote>
<p>Si necesitás <strong>crear una lista de artículos al azar</strong> tenés suerte, ya que es algo bastante fácil de hacer.</p>
<p>Para hacer esto, abris el archivo donde querés mostrar la lista y agregás el código que está más abajo, yo por ejempo lo hize con el sidebar y quedó así:</p>
<div align="center"><img src="http://wordpress-hacks.com/wp-content/uploads/2010/11/post-al-azar.jpg" alt="" title="posts al azar" width="351" height="373" class="alignnone size-full wp-image-639" /></div>
<p>El código sería el siguiente:</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;h3&gt;Art&amp;iacute;culos al azar&lt;/h3&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;ul&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$rand_posts</span> = get_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'numberposts=5&amp;orderby=rand'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$rand_posts</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$post</span> <span style="color:#006600; font-weight:bold;">&#41;</span> :</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;li&gt;&lt;a title=<span style="color:#FF0000;">"&lt;?php the_title(); ?&gt;"</span> href=<span style="color:#FF0000;">"&lt;?php the_permalink(); ?&gt;"</span>&gt;&lt;?php the_title<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt;&lt;/a&gt;&lt;/li&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> endforeach; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/ul&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Por supuesto que en "numberposts=5" pueden ponerle el número de artículos a mostrar que ustedes quieran.</p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/crear-lista-random-posts.php/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>the_excerpt lenght</title>
		<link>http://wordpress-hacks.com/the_excerpt-lenght.php</link>
		<comments>http://wordpress-hacks.com/the_excerpt-lenght.php#comments</comments>
		<pubDate>Tue, 02 Nov 2010 22:39:16 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=629</guid>
		<description><![CDATA[O cómo limitar el número de palabras que aparecen en the_excerpt, por supuesto sin plugins como acostumbramos. No me voy a poner a explicar lo que es the_excerpt, pero si no saben lo que es, siempre el codex es la mejor opción. Realmente no se cuantas son las palabras por [...]]]></description>
			<content:encoded><![CDATA[<p>O cómo limitar el número de palabras que aparecen en the_excerpt, por supuesto sin plugins como acostumbramos.</p>
<p>No me voy a poner a explicar lo que es the_excerpt, pero si no saben lo que es, siempre <a href="http://codex.wordpress.org/Function_Reference/the_excerpt">el codex</a> es la mejor opción.</p>
<p>Realmente no se cuantas son las palabras por defecto que muestra WordPress si utilizamos the_excerpt, aunque creo que son 100.</p>
<p>El problema (que en realidad ya no será problema) viene cuando nos interesa poner por ejemplo solo 50 palabras y no 100, he aquí la magia del functions.php, ya que lo vamos a abrir y vamos a agregar lo siguiente:</p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> new_excerpt_length<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$length</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> xx;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'excerpt_length'</span>, <span style="color:#FF0000;">'new_excerpt_length'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Donde xx es el número de palabras que querés que muestre wp en cada excerpt.</p>
<p>pd: no olviden que si no tienen la llamada the_excerpt() en el archivo donde llaman a los posts y tienen por ejemplo the_content() esto no anda <img src='http://wordpress-hacks.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .<br />
pd2: a nadie le importa, pero les cuento que estoy por sacar un nuevo diseño para el sitio, que me gusta bastante y espero que le guste a varios.</p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/the_excerpt-lenght.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 3, fechas en español</title>
		<link>http://wordpress-hacks.com/wordpress-3-fechas-en-espanol.php</link>
		<comments>http://wordpress-hacks.com/wordpress-3-fechas-en-espanol.php#comments</comments>
		<pubDate>Thu, 17 Jun 2010 23:53:16 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress 3]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=604</guid>
		<description><![CDATA[Algunos renegados usamos WordPress en inglés, yo particularmente porque me siento más cómodo, y cada uno tendrá su motivo, pero con wp en inglés las fechas también están en inglés y eso queda feo si escribimos blogs en español y nuestros visitantes son de habla hispana, por lo que, traducir [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wordpress-hacks.com/wp-content/uploads/2010/06/Milestone-WordPress-3.png" alt="" title="Milestone WordPress 3" width="617" height="138" class="alignnone size-full wp-image-606" /></p>
<p>Algunos renegados usamos WordPress en inglés, yo particularmente porque me siento más cómodo, y cada uno tendrá su motivo, pero con wp en inglés las fechas también están en inglés y eso queda feo si escribimos blogs en español y nuestros visitantes son de habla hispana, por lo que, traducir y subir el locale.php es la mejor opción para poner <a href="http://wordpress-hacks.com/pasar-wordpress-a-espanol-modificando-el-localephp.php">WordPress en español</a>, ahora como cambió el archivo (locale.php), lo he traducido de nuevo para que puedan bajarlo y subirlo en /wp-includes, si lo descargan, deben renombrar locale.txt a locale.php, o si no pueden copiarlo y crear un nuevo locale.php y pegarlo.<br />
<span id="more-604"></span></p>
<p><a href="http://wordpress-hacks.com/wp-content/uploads/2010/06/locale.txt">Descargarlo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/wordpress-3-fechas-en-espanol.php/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Listar posts de la misma categoría sin plugins</title>
		<link>http://wordpress-hacks.com/listar-posts-de-la-misma-categoria.php</link>
		<comments>http://wordpress-hacks.com/listar-posts-de-la-misma-categoria.php#comments</comments>
		<pubDate>Tue, 27 Apr 2010 22:49:46 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[listar categorias]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=532</guid>
		<description><![CDATA[Junto con Diego, el pibe que labura conmigo, estamos armando un sitio de ventas y necesitábamos listar otros posts de la misma categoría y no queríamos usar ningún plugin, a continuación el código: Ver texto plano PHP: &#60;?php if &#40; is_single&#40;&#41; &#41; &#123; // Si es un single post &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Junto con Diego, el pibe que labura conmigo, estamos armando un sitio de ventas y necesitábamos <strong>listar otros posts de la misma categoría</strong> y no queríamos usar ningún plugin, a continuación el código:</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> is_single<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#FF9933; font-style:italic;">// Si es un single post</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#0000FF;">$cat</span> = the_category_ID<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">FALSE</span><span style="color:#006600; font-weight:bold;">&#41;</span> ; <span style="color:#FF9933; font-style:italic;">// El id de la categoría, el (FALSE) es para que no escriba el número</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#0000FF;">$post</span> = get_the_ID<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// El id del current post</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#0000FF;">$args</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF9933; font-style:italic;">// La variable</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'cat'</span>=&gt;<span style="color:#0000FF;">$cat</span>, <span style="color:#FF9933; font-style:italic;">// El id de la categoría que buscamos arriba</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'showposts'</span> =&gt; <span style="color:#CC66CC;color:#800000;">3</span>, <span style="color:#FF9933; font-style:italic;">// El número de posts que se van a listar</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'post__not_in'</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#FF9933; font-style:italic;">// Llama al id del post actual para que no sea listado</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora para que se muestren los posts ponemos esto:<br />
<span id="more-532"></span></p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;h4&gt;Relacionados:&lt;/h4&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;ul&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$recent</span> = <span style="color:#000000; font-weight:bold;">new</span> WP_Query<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$args</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#616100;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$recent</span>-&gt;<span style="color:#006600;">have_posts</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#0000FF;">$recent</span>-&gt;<span style="color:#006600;">the_post</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;strong&gt;&lt;a href=<span style="color:#FF0000;">"&lt;?php the_permalink() ?&gt;"</span> rel=<span style="color:#FF0000;">"bookmark"</span>&gt;&lt;?php the_title<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">endwhile</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/ul&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>El código completo:</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> is_single<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#FF9933; font-style:italic;">// Si es un single post</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#0000FF;">$cat</span> = the_category_ID<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">FALSE</span><span style="color:#006600; font-weight:bold;">&#41;</span> ; <span style="color:#FF9933; font-style:italic;">// El id de la categoría, el (FALSE) es para que no escriba el número</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#0000FF;">$post</span> = get_the_ID<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// El id del current post</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#0000FF;">$args</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF9933; font-style:italic;">// La variable</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'cat'</span>=&gt;<span style="color:#0000FF;">$cat</span>, <span style="color:#FF9933; font-style:italic;">// El id de la categoría que buscamos arriba</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'showposts'</span> =&gt; <span style="color:#CC66CC;color:#800000;">3</span>, <span style="color:#FF9933; font-style:italic;">// El número de posts que se van a listar</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'post__not_in'</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#FF9933; font-style:italic;">// Llama al id del post actual para que no sea listado</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;h4&gt;Relacionados&lt;/h4&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;ul&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$recent</span> = <span style="color:#000000; font-weight:bold;">new</span> WP_Query<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$args</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#616100;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$recent</span>-&gt;<span style="color:#006600;">have_posts</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#0000FF;">$recent</span>-&gt;<span style="color:#006600;">the_post</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt;&nbsp;&nbsp;&nbsp;&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;li&gt;&lt;strong&gt;&lt;a href=<span style="color:#FF0000;">"&lt;?php the_permalink() ?&gt;"</span> rel=<span style="color:#FF0000;">"bookmark"</span>&gt;&lt;?php the_title<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">endwhile</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/ul&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Cualquier duda pregunten que vemos si la resolvemos <img src='http://wordpress-hacks.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/listar-posts-de-la-misma-categoria.php/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Metas descripciones en tags y categorías sin plugins</title>
		<link>http://wordpress-hacks.com/metas-descriptions-en-tags-y-categorias.php</link>
		<comments>http://wordpress-hacks.com/metas-descriptions-en-tags-y-categorias.php#comments</comments>
		<pubDate>Mon, 14 Dec 2009 19:15:38 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Meta Tags]]></category>
		<category><![CDATA[Tags Descriptions]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=513</guid>
		<description><![CDATA[La meta tag description es una de las más importantes a la hora de hacer seo on page en un sitio, si tenemos categorías y tags que sean relevantes seguro podrán aprovechar este artículo. Desconozco si algún plugin para optimización seo tiene implementado las descripciones en las tags, ya que [...]]]></description>
			<content:encoded><![CDATA[<p>La <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=es&amp;answer=79812">meta tag description</a> es una de las más importantes a la hora de hacer <a href="http://blog.ikhuerta.com/bases-del-seo-onpage">seo on page</a> en un sitio, si tenemos categorías y tags que sean relevantes seguro podrán aprovechar este artículo.</p>
<div align="center"><img src="http://wordpress-hacks.com/wp-content/uploads/2009/12/meta_tags-300x242.jpg" alt="meta tags" title="meta tags" width="300" height="242" class="aligncenter size-medium wp-image-515" /></div>
<p>Desconozco si algún plugin para optimización seo tiene implementado las descripciones en las tags, ya que desde la <a href="http://wordpress-hacks.com/tags-descriptions-en-wordpress-28.php">versión 2.8 de WordPress</a> se pueden agregar, pero probablemente si.</p>
<p>Ayer estuve gran parte de la tarde buscando el mejor código para hacer esto y me decidí por el siguiente:</p>
<p>Para llamar las descripciones en tags:</p>
<div class="igBar"><span id="lphp-17"><a href="#" onclick="javascript:showPlainTxt('php-17'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-17">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> is_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;meta name=<span style="color:#FF0000;">"description"</span> content=<span style="color:#FF0000;">"&lt;?php echo tag_description() ?&gt;"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">endif</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>en categorías:</p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showPlainTxt('php-18'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-18">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> is_category<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;meta name=<span style="color:#FF0000;">"description"</span> content=<span style="color:#FF0000;">"&lt;?php echo category_description() ?&gt;"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">endif</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Este código obviamente va en el header antes de /head.</p>
<p>El problema que tenía era que me quedaban las descripciones con un &lt;p&gt; y &lt;/p&gt; , por ejemplo quedaba:</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;meta name=<span style="color:#FF0000;">"description"</span> content=<span style="color:#FF0000;">"&lt;p&gt;descripcion&lt;/p&gt;"</span> /&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Anduve buscando por un rato y encontré algo que realmente desconocía, la <a href="http://codex.wordpress.org/Function_Reference/wpautop">función wpautop</a>, fuí al <a href="http://ma.tt/scripts/autop/">blog de Matt</a> y entendí un poco más.</p>
<p>Al rato encontré en el foro de Wp <a href="http://wordpress.org/support/topic/137008#post-625941">la solución</a> a mi problema.</p>
<p>Hay que agregar la siguiente línea en el <strong>functions.php</strong> del theme en uso:</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">remove_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'term_description'</span>,<span style="color:#FF0000;">'wpautop'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para los desprevenidos que se pregunten donde agregar las descripciones a los tags y las categorías les respondo que se hacen entrando a la lista de tags o categorías y dándo clic en editar -no en edición rápida- y agregando en el campo descripción lo que queramos mostrar.</p>
<p><em>Nota:</em> si usan algún "plugin seo" chequeen que no les quede duplicada la descripción, la mayoría de los plugins seo que conozco solo agregan la meta tag description a las categorías y no a los tags, si es su caso pueden agregar solo el código para las descripciones de los tags.</p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/metas-descriptions-en-tags-y-categorias.php/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Poner la query de una búsqueda como título</title>
		<link>http://wordpress-hacks.com/poner-la-query-de-una-busqueda-como-titulo.php</link>
		<comments>http://wordpress-hacks.com/poner-la-query-de-una-busqueda-como-titulo.php#comments</comments>
		<pubDate>Fri, 30 Oct 2009 23:59:09 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[get_search_query()]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=454</guid>
		<description><![CDATA[Si tenés un blog y posicionas algunas búsquedas a mi entender una buena idea de potenciar el seo es poner el título de la búsqueda en la tag &#60;title&#62; y poner en h1 o h2 también la query de búsqueda, un ejemplo del title: Para hacer esto, simplemente hay que [...]]]></description>
			<content:encoded><![CDATA[<p>Si tenés un blog y posicionas algunas búsquedas a mi entender una buena idea de potenciar el seo es poner el título de la búsqueda en la tag &lt;title&gt; y poner en h1 o h2 también la query de búsqueda, un ejemplo del title:</p>
<p style="text-align: center;"><img class="size-full wp-image-455 aligncenter" title="busquedas" src="http://wordpress-hacks.com/wp-content/uploads/2009/10/busquedas.png" alt="busquedas" width="500" height="109" /></p>
<p>Para hacer esto, simplemente hay que hacer lo mismo que expliqué para los <a href="http://wordpress-hacks.com/titulos-y-formas-de-configurarlos-para-un-mejor-seo.php">títulos seo</a>, en caso que tengan en el título lo del articulo antes mencionado busquen la parte que dice:</p>
<div class="igBar"><span id="lphp-25"><a href="#" onclick="javascript:showPlainTxt('php-25'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-25">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> is_search<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> ?&gt;&lt;?php bloginfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'name'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt;&amp;nbsp;|&amp;nbsp;Busqueda&lt;?php <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y lo reemplazan por:</p>
<div class="igBar"><span id="lphp-26"><a href="#" onclick="javascript:showPlainTxt('php-26'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-26">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> is_search<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> ?&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$_GET</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'s'</span><span style="color:#006600; font-weight:bold;">&#93;</span> ?&gt;&lt;?php <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora, para poner un h1 con la búsqueda se me ocurre poner en el search.php antes que empiece el contenido esto:</p>
<div class="igBar"><span id="lphp-27"><a href="#" onclick="javascript:showPlainTxt('php-27'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-27">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> get_search_query<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La función <strong>get_search_query()</strong> llama a la búsqueda y la imprime, podría quedar algo así como:</p>
<div class="igBar"><span id="lphp-28"><a href="#" onclick="javascript:showPlainTxt('php-28'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-28">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;h1&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> get_search_query<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt;&lt;/h1&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/poner-la-query-de-una-busqueda-como-titulo.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacks wp</title>
		<link>http://wordpress-hacks.com/hacks-wp.php</link>
		<comments>http://wordpress-hacks.com/hacks-wp.php#comments</comments>
		<pubDate>Tue, 20 Oct 2009 23:01:38 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Nofollow a comentarios]]></category>
		<category><![CDATA[Nube de tags]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=450</guid>
		<description><![CDATA[Hacks wp es el nombre de un txt que tengo desde siempre en el que anoto hacks o lo que sea que luego necesite consultar y no pierda demasiado tiempo en algo insignificante, espero que sirva. Directorio del theme: Ver texto plano PHP: &#60;?php bloginfo&#40;'template_directory'&#41;; ?&#62; Nube de tags: Ver [...]]]></description>
			<content:encoded><![CDATA[<p>Hacks wp es el nombre de un txt que tengo desde siempre en el que anoto hacks o lo que sea que luego necesite consultar y no pierda demasiado tiempo en algo insignificante, espero que sirva.</p>
<p>Directorio del theme:</p>
<div class="igBar"><span id="lphp-36"><a href="#" onclick="javascript:showPlainTxt('php-36'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-36">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> bloginfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'template_directory'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nube de tags:</p>
<div class="igBar"><span id="lphp-37"><a href="#" onclick="javascript:showPlainTxt('php-37'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-37">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> wp_tag_cloud<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nofollow a comentarios:</p>
<div class="igBar"><span id="lphp-38"><a href="#" onclick="javascript:showPlainTxt('php-38'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-38">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;a href=<span style="color:#FF0000;">"&lt;?php the_permalink() ?&gt;#respond"</span> rel=<span style="color:#FF0000;">"nofollow"</span>&gt;&lt;?php comments_number<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Hacer un comentario'</span>, <span style="color:#FF0000;">'1 Comentario'</span>, <span style="color:#FF0000;">'% Comentarios'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt;&lt;/a&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Hora personalizada:</p>
<div class="igBar"><span id="lphp-39"><a href="#" onclick="javascript:showPlainTxt('php-39'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-39">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> the_time<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'j <span style="color:#000099; font-weight:bold;">\d</span><span style="color:#000099; font-weight:bold;">\e</span> F <span style="color:#000099; font-weight:bold;">\d</span><span style="color:#000099; font-weight:bold;">\e</span> Y'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Url del sitio:</p>
<div class="igBar"><span id="lphp-40"><a href="#" onclick="javascript:showPlainTxt('php-40'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-40">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> get_option<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'siteurl'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Archivo ordenado por meses:</p>
<div class="igBar"><span id="lphp-41"><a href="#" onclick="javascript:showPlainTxt('php-41'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-41">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> wp_get_archives<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'type=monthly'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Enlaces del blogroll:</p>
<div class="igBar"><span id="lphp-42"><a href="#" onclick="javascript:showPlainTxt('php-42'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-42">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> get_links<span style="color:#006600; font-weight:bold;">&#40;</span>-<span style="color:#CC66CC;color:#800000;">1</span>, <span style="color:#FF0000;">'&lt;li&gt;'</span>, <span style="color:#FF0000;">'&lt;/li&gt;'</span>, <span style="color:#FF0000;">' - '</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/hacks-wp.php/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Recibiendo el Permalink de los comentarios en las notificaciones</title>
		<link>http://wordpress-hacks.com/recibiendo-el-permalink-de-los-comentarios-en-las-notificaciones.php</link>
		<comments>http://wordpress-hacks.com/recibiendo-el-permalink-de-los-comentarios-en-las-notificaciones.php#comments</comments>
		<pubDate>Wed, 02 Sep 2009 13:42:11 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[get_comment_link]]></category>
		<category><![CDATA[pluggable.php]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=438</guid>
		<description><![CDATA[Ayer conversando con David salió el tema este, me preguntó como se podría hacer eso, me había quedado bastante claro, pero hoy cuando lo fuí a hacer me había olvidado que era lo que david quería. Hoy al volver a preguntar y al entender puse manos a la obra. David [...]]]></description>
			<content:encoded><![CDATA[<p>Ayer conversando con <a href="http://dondado.es">David</a> salió el tema este, me preguntó como se podría hacer eso, me había quedado bastante claro, pero hoy cuando lo fuí a hacer me había olvidado que era lo que david quería. Hoy al volver a preguntar y al entender puse manos a la obra.</p>
<p>David quería recibir el permalink (enlace) del comentario en cuestión cada vez que dejaban un comentario y le llegaba un e-mail de notificación.<br />
Algo así:</p>
<p><img src="http://wordpress-hacks.com/wp-content/uploads/2009/09/comentarios.png" alt="comentarios" title="comentarios" width="650" height="182" class="alignnone size-full wp-image-439" /></p>
<h3>Poniendo código a la obra:</h3>
<p>Buscamos el archivo <strong>pluggable.php</strong> que está en /includes, lo abrimos y vamos a la linea 1014 en donde dice algo así como:</p>
<div class="igBar"><span id="lphp-49"><a href="#" onclick="javascript:showPlainTxt('php-49'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-49">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= get_permalink<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_post_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"#comments<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Viendo las líneas 1014, 1015 y 1016 inclusive, vemos lo siguiente:</p>
<div class="igBar"><span id="lphp-50"><a href="#" onclick="javascript:showPlainTxt('php-50'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-50">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= get_permalink<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_post_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"#comments<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Delete it: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, admin_url<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"comment.php?action=cdc&amp;c=$comment_id"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Spam it: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, admin_url<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"comment.php?action=cdc&amp;dt=spam&amp;c=$comment_id"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Agregamos una línea abajo de la de "spam"</p>
<div class="igBar"><span id="lphp-51"><a href="#" onclick="javascript:showPlainTxt('php-51'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-51">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Comentario: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, get_comment_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>. <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Lo que quedaría:</p>
<div class="igBar"><span id="lphp-52"><a href="#" onclick="javascript:showPlainTxt('php-52'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-52">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= get_permalink<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_post_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"#comments<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Delete it: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, admin_url<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"comment.php?action=cdc&amp;c=$comment_id"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Spam it: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, admin_url<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"comment.php?action=cdc&amp;dt=spam&amp;c=$comment_id"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Comentario: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, get_comment_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>. <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Notas:<br />
Esto funciona para los themes que tengan integrado esto de que cada comentario tiene permalink, de lo contrario redireccionará a la url del artículo.<br />
Tampoco esto va a funcionar para los blogs que tienen los comentarios paginados.</p>
<p>Creo que a esta altura está de más decir que cada uno lo puede personalizar como más le guste.</p>
<h2>Actualización:</h2>
<p>David me dice que tal vez funcione mejor con la función get_comment_link, asi que he probado y usando esa función sirve también para los comentarios paginados. Cambiar la línea:</p>
<div class="igBar"><span id="lphp-53"><a href="#" onclick="javascript:showPlainTxt('php-53'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-53">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Comentario: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, get_permalink<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_post_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"#comment-$comment_id"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Por esta:</p>
<div class="igBar"><span id="lphp-54"><a href="#" onclick="javascript:showPlainTxt('php-54'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-54">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$notify_message</span> .= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Comentario: %s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, get_comment_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>. <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/recibiendo-el-permalink-de-los-comentarios-en-las-notificaciones.php/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Listando los últimos comentarios y personalizando el texto</title>
		<link>http://wordpress-hacks.com/listar-ultimos-comentarios-y-personalizarlos.php</link>
		<comments>http://wordpress-hacks.com/listar-ultimos-comentarios-y-personalizarlos.php#comments</comments>
		<pubDate>Tue, 01 Sep 2009 11:48:40 +0000</pubDate>
		<dc:creator>Neri Aispuro</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[get latest comments]]></category>
		<category><![CDATA[listar ultimos comentarios]]></category>

		<guid isPermaLink="false">http://wordpress-hacks.com/?p=434</guid>
		<description><![CDATA[(imagen del genio de Palomitas y Maíz) Listar los comentarios recientes es bastante molesto a veces, ya que no existe documentación precisa en el codex y todo es bastante "Extra oficial". Hoy mirando un poco el código de wp para personalizar un poco más los comentarios, me di cuenta que [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><img src="http://wordpress-hacks.com/wp-content/uploads/2009/09/comentarios.jpg" alt="Comentarios! - de palomitas y maíz" title="Comentarios! - de palomitas y maíz" width="405" height="500" class="alignnone size-full wp-image-436" /><br />
(imagen del genio de <a href="http://palomitasymaiz.wordpress.com/2009/07/09/comentarios-2/">Palomitas y Maíz</a>)</div>
<p>Listar los comentarios recientes es bastante molesto a veces, ya que no existe documentación precisa en el codex y todo es bastante "Extra oficial".</p>
<p>Hoy mirando un poco el código de wp para personalizar un poco más los comentarios, me di cuenta que lo mejor para hacer esto es haciéndolo con los famosos widgets.</p>
<p>Personalizando:</p>
<p>Yo quería cambiar el "on" por "en", por ejemplo de "Marcelo on php the_time – La hora y fecha en WordPress" quería que quede "Marcelo en php the_time – La hora y fecha en WordPress".</p>
<p>No costó mucho hacerlo, solo cambiar "%1$s on %2$s" en la línea 647 del archivo <strong>default-widgets.php</strong> en /includes por "%1$s en %2$s".</p>
<p>También le agregué Nofollow al id del comentario, (aunque matt joda que los enlaces internos no deben llevar nofollow).</p>
<p>Esto también en la línea 647, en la parte que dice:</p>
<div class="igBar"><span id="lphp-58"><a href="#" onclick="javascript:showPlainTxt('php-58'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-58">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">'&lt;a href=&quot;'</span> . esc_url<span style="color:#006600; font-weight:bold;">&#40;</span> get_comment_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&quot;&gt;'</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Cambié por:</p>
<div class="igBar"><span id="lphp-59"><a href="#" onclick="javascript:showPlainTxt('php-59'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-59">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">'&lt;a rel=&quot;nofollow&quot; href=&quot;'</span> . esc_url<span style="color:#006600; font-weight:bold;">&#40;</span> get_comment_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&quot;&gt;'</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para listar los comentarios recientes "a mano" sin widgets lo mejor que <a href="http://wordpress.org/support/topic/272265">encontré</a> es:</p>
<div class="igBar"><span id="lphp-60"><a href="#" onclick="javascript:showPlainTxt('php-60'); return false;">Ver texto plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-60">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$number</span>=<span style="color:#CC66CC;color:#800000;">5</span>; <span style="color:#FF9933; font-style:italic;">// Número de comentarios recientes que queremos mostrar (cambiar el 5)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$comments</span> = <span style="color:#0000FF;">$wpdb</span>-&gt;<span style="color:#006600;">get_results</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"SELECT * FROM $wpdb-&gt;comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;ul id=<span style="color:#FF0000;">"recentcomments"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;h2&gt;Comentarios recientes&lt;/h2&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$comments</span> <span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$comments</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$comment</span><span style="color:#006600; font-weight:bold;">&#41;</span> :</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a>&nbsp; <span style="color:#FF0000;">'&lt;li class=&quot;recentcomments&quot;&gt;'</span> . <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>__<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'%1$s en %2$s'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, get_comment_author_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#FF0000;">'&lt;a href=&quot;'</span>. get_comment_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&quot;&gt;'</span> . get_the_title<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_post_ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&lt;/a&gt;'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&lt;/li&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">endforeach; <span style="color:#616100;">endif</span>;?&gt;&lt;/ul&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahí por defecto llama los últimos 5 comentarios y los imprime como "Marcelo en php the_time – La hora y fecha en WordPress" pero sin nofollow, quien quiera lo agrega, eso va en cada uno.</p>
]]></content:encoded>
			<wfw:commentRss>http://wordpress-hacks.com/listar-ultimos-comentarios-y-personalizarlos.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

