<?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>Planeta WordPress &#187; Funciones</title>
	<atom:link href="http://planetawordpress.org/tag/funciones/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetawordpress.org</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 16:36:09 +0000</lastBuildDate>
	<generator>http://weblog.mx/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>¡He quitado el archivo!</title>
		<link>http://ayudawordpress.com/he-quitado-el-archivo/</link>
		<comments>http://ayudawordpress.com/he-quitado-el-archivo/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 14:27:25 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Avanzado]]></category>
		<category><![CDATA[código]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[Tutoriales / Trucos]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=8417</guid>
		<description><![CDATA[Si te has fijado, ya no dispones de un widget en la barra lateral mediante el que navegar por el archivo de Ayuda WordPress. Y no es que te tenga manía o que quiera ocultar el pasado, es simplemente que he encontrado un modo mejor (muuuucho mejor) de ofrecer el archivo de lo publicado. ¿He [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayudawordpress.com/wp-content/uploads/2010/08/archivator.jpg" alt="" title="archivator" width="400" height="526" class="aligncenter size-full wp-image-8418" /></p>
<p>Si te has fijado, ya no dispones de un widget en la barra lateral mediante el que navegar por el archivo de <a href="http://ayudawordpress.com/">Ayuda WordPress</a>. Y no es que te tenga manía o que quiera ocultar el pasado, es simplemente que he encontrado un modo mejor (muuuucho mejor) de ofrecer el archivo de lo publicado.</p>
<p>¿He despertado tu curiosidad? …</p>
<p><span id="more-8417"></span></p>
<p>Te propongo un juego, y es que descubras como navegar por el archivo del blog. Porque estar ahí está, en cada post, en la portada, en la navegación por categorías, por etiquetas, en el sitio más obvio posible ¿aún no lo has acertado?. Venga, un poco de atención … </p>
<p><em>(si no das con ello pasa a la página 2)</em></p>
<!-- PHP 4.x --><p class='fb-like'><iframe src='http://www.facebook.com/plugins/like.php?href=http://ayudawordpress.com/he-quitado-el-archivo/&amp;layout=standard&amp;show_faces=true&amp;width=260&amp;action=like&amp;colorscheme=light' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:260px; height:26px'></iframe></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=b3K174vGjkI:UblJU8UvHWc:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=b3K174vGjkI:UblJU8UvHWc:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/b3K174vGjkI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ayudawordpress.com/he-quitado-el-archivo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>¡Galerías para todos!</title>
		<link>http://ayudawordpress.com/galerias-para-todos/</link>
		<comments>http://ayudawordpress.com/galerias-para-todos/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 18:09:39 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Avanzado]]></category>
		<category><![CDATA[BuddyPress]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[Comunidad]]></category>
		<category><![CDATA[fotos]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[Usuarios]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=8409</guid>
		<description><![CDATA[Si tienes un sitio en el que quieres generar comunidad, ofrecer servicios a tus usuarios más allá de lo incluido en WordPress, o quieres convertir tu WordPress+BuddyPress en un auténtico portal, o simplemente permitir cierta interacción de tus visitantes, permitiéndoles subir sus fotos, lo puedes conseguir de manera bien sencilla. Se me ocurren muchas situaciones [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ayudawordpress.com/wp-content/uploads/2010/08/captura-2010-08-06-a-las-20.03.54.png" title="captura 2010-08-06 a las 20.03.54" rel="lightbox[8409]"><img src="http://ayudawordpress.com/wp-content/uploads/2010/08/captura-2010-08-06-a-las-20.03.54-500x288.png" alt="" title="captura 2010-08-06 a las 20.03.54" width="500" height="288" class="aligncenter size-medium wp-image-8412" /></a></p>
<p>Si tienes un sitio en el que quieres <strong>generar comunidad</strong>, ofrecer servicios a tus usuarios más allá de lo incluido en WordPress, o quieres convertir tu <strong>WordPress+BuddyPress</strong> en un auténtico portal, o simplemente permitir cierta interacción de tus visitantes, <strong>permitiéndoles subir sus fotos</strong>, lo puedes conseguir de manera bien sencilla.<br />
<span id="more-8409"></span></p>
<p>Se me ocurren muchas situaciones en las que usar algo así, ya sea una comunidad de aficionados a la fotografía, amigos de las mascotas, un blog familiar, etc, simplemente <strong>echa a volar la imaginación</strong> porque desde ya mismo puedes <strong>ofrecer a tus visitantes subir fotos incluso sin estar registrados</strong> en tu WordPress.</p>
<p>Gracias a <strong>PhotoSmash Galleries</strong>, un plugin impresionante, puedes hacer eso y mucho más. Y es que no solo te permite crear galerías con funcionalidades muy superiores a las incluidas en WordPress sino que puedes permitir <strong>que los usuarios de tu sitio suban sus propias imágenes y tengan su propia galería</strong>. Puedes crear varias galerías, unas para los autores, otras para visitantes, incluirlas en posts y páginas, añadir votos y que los lectores hagan su lista de favoritas, etc, etc, etc. Las posibilidades son casi infinitas.</p>
<p>Además, eso es solo con las funciones básicas, si activas los menús avanzados entras en el apasionante mundo de los campos personalizados y los <code>shortcodes</code>.</p>

<a href='http://ayudawordpress.com/galerias-para-todos/captura-2010-08-06-a-las-20-03-08/' ><img width="150" height="150" src="http://ayudawordpress.com/wp-content/uploads/2010/08/captura-2010-08-06-a-las-20.03.08-150x150.png" class="attachment-thumbnail" alt="captura 2010-08-06 a las 20.03.08" title="captura 2010-08-06 a las 20.03.08" /></a>
<a href='http://ayudawordpress.com/galerias-para-todos/captura-2010-08-06-a-las-20-03-42/' ><img width="150" height="150" src="http://ayudawordpress.com/wp-content/uploads/2010/08/captura-2010-08-06-a-las-20.03.42-150x150.png" class="attachment-thumbnail" alt="captura 2010-08-06 a las 20.03.42" title="captura 2010-08-06 a las 20.03.42" /></a>
<a href='http://ayudawordpress.com/galerias-para-todos/captura-2010-08-06-a-las-20-03-54/' ><img width="150" height="150" src="http://ayudawordpress.com/wp-content/uploads/2010/08/captura-2010-08-06-a-las-20.03.54-150x150.png" class="attachment-thumbnail" alt="captura 2010-08-06 a las 20.03.54" title="captura 2010-08-06 a las 20.03.54" /></a>
<a href='http://ayudawordpress.com/galerias-para-todos/captura-2010-08-06-a-las-20-04-11/' ><img width="150" height="150" src="http://ayudawordpress.com/wp-content/uploads/2010/08/captura-2010-08-06-a-las-20.04.11-150x150.png" class="attachment-thumbnail" alt="captura 2010-08-06 a las 20.04.11" title="captura 2010-08-06 a las 20.04.11" /></a>

<p><strong>La lista de utilidades que le puedes dar solo tiene como límite tu imaginación</strong> y, por supuesto, que pases un rato configurando los cientos de opciones disponibles y haciendo pruebas. Ah, también te ofrece widgets con los que mostrar las tags de las fotos e incluso las últimas, las más votadas, lo que quieras, ya te digo que es muy completo.</p>
<p>Si quieres ver como funciona, a nivel básico, puedes probarlo <a href="http://ayudawordpress.com/cms/tus-fotos">en esta página que he creado</a> (el límite de tamaño por foto es de 300 kb), y si te convence instálalo desde WordPress o descargándolo en <a href="http://wordpress.org/extend/plugins/photosmash-galleries/">la página del plugin</a>.</p>
<p>Espero que te guste, yo hace tiempo que buscaba algo así para un montón de ideas que tengo para algunos proyectos.<br />
<h3><font color="#000080">Contenido exclusivo para suscriptores al Feed</font></h3>
<p><font color="#808080">¡Gracias por seguirnos a diario!. Premiamos tu fidelidad ofreciéndote habitualmente contenidos exclusivos. Hoy puedes descargar:</font></p>
<p><a href="http://ayudawordpress.com/?dl_id=68" title="Clic aquí para iniciar la descarga"><img src="http://ayudawordpress.com/wp-content/uploads/2008/01/wp-install.jpg" alt="Clic aquí para iniciar la descarga" align="middle" border="0" height="59" width="43" /> Guía Windows Live Writer</a></p>
<!-- PHP 4.x --><p class='fb-like'><iframe src='http://www.facebook.com/plugins/like.php?href=http://ayudawordpress.com/galerias-para-todos/&amp;layout=standard&amp;show_faces=true&amp;width=260&amp;action=like&amp;colorscheme=light' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:260px; height:26px'></iframe></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=R3bhp_-tyy4:If0F4FxtaQ4:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=R3bhp_-tyy4:If0F4FxtaQ4:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/R3bhp_-tyy4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ayudawordpress.com/galerias-para-todos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cientos de temas preparados para WordPress 3.0</title>
		<link>http://feedproxy.google.com/~r/AyudaWordpress/~3/cXpcaO9BuWo/</link>
		<comments>http://feedproxy.google.com/~r/AyudaWordpress/~3/cXpcaO9BuWo/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 18:12:45 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress 3.0]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=8328</guid>
		<description><![CDATA[Mira que siempre os digo que no hay nada como aprender uno mismo a hacer las cosas. Además, que es muy fácil añadir las funciones básicas que necesita un tema para estar preparado para las novedades de WordPress 3.0: los menús, fondos personalizados, etc. Pero vaya, que como sé que siempre nos entra la flojera [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ayudawordpress.com/wp-content/uploads/2010/07/wordpress3.png" title="wordpress3" rel="lightbox[8328]"><img class="aligncenter size-medium wp-image-8329" title="wordpress3" src="http://ayudawordpress.com/wp-content/uploads/2010/07/wordpress3-500x280.png" alt="" width="500" height="280" /></a></p>
<p>Mira que siempre os digo que no hay nada como aprender uno mismo a hacer las cosas. Además, que es muy fácil añadir las funciones básicas que necesita un tema para estar preparado para las <a href="http://ayudawordpress.com/todas-las-novedades-de-wordpress-3-0/">novedades de WordPress 3.0</a>: los menús, fondos personalizados, etc.</p>
<p>Pero vaya, que como sé que siempre nos entra la flojera cuando hay una nueva versión, y si otro lo ha hecho ya <strong>¿para qué perder tiempo uno mismo?</strong>, pues he recopilado un buen montón de sitios donde podéis descargar temas ya preparados para todas las funciones nuevas de <strong>WordPress 3.0</strong> y, por supuesto, anteriores …</p>
<ol>
<li>Todos <a href="http://templatic.com/wordpress-themes-store">los temas de Templatic</a> están <a href="http://templatic.com/news/yes-we-are-wordpress-3-0-ready">adaptados a WordPress 3.0</a></li>
<li>Elegant Themes <a href="http://www.elegantthemes.com/blog/theme-changesbug-fixes/all-themes-updated-for-wordpress-3-0">también</a> ha adaptado <a href="http://www.elegantthemes.com/gallery">todos sus maravillosos temas</a> a WordPress 3.0.</li>
<li>Todos los <a href="http://www.site5.com/wordpress-themes/">temas gratuitos de Site5</a>.</li>
<li><a href="http://themeforest.net/searches?term=WordPress+3.0&amp;categories%5Bwordpress%5D=1&amp;type=collections">Algunos de Theme Forest</a>.</li>
<li>Muchos <a href="http://wordpress.org/extend/themes/search.php?q=WordPress+3.0">en el repositorio oficial</a> de WordPress.org.</li>
<li>Todos los <a href="http://www.obox-design.com/themes_shop.cfm">temas de Obox</a>.</li>
<li><a href="http://www.presscoders.com/themes/chunky-theme/">Chunky theme</a>.</li>
<li><a href="http://3oneseven.com/04/tech-9/">Tech 9 theme</a>.</li>
<li><a href="http://www.presscoders.com/themes/twist-of-ten-theme/">Twist of Ten theme</a></li>
<li><a href="http://wpfeed.com/2010/06/wp3theme-free-wordpress-3-0-theme/">WP3Theme</a></li>
<li>Todos los <a href="http://www.woothemes.com/themes/">temas de Woothemes</a></li>
<li><a href="http://www.premiumwordpressthemes.co.uk/theme/studiopress/">StudioPress</a></li>
<li>Todos los <a href="http://themeshift.com/">temas de ThemeShift</a></li>
<li>Todos <a href="http://www.nattywp.com/">los de NattyWP</a></li>
<li>Todos los temas de <a href="http://www.wpnow.com/">WPnow</a></li>
</ol>
<p>Hay una enorme cantidad de temas ya adaptados a WordPress 3.0 como puedes comprobar, y si conoces más nos lo cuentas en los comentarios <img src='http://ayudawordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<!-- PHP 4.x --><p class='fb-like'><iframe src='http://www.facebook.com/plugins/like.php?href=http://ayudawordpress.com/cientos-de-temas-preparados-para-wordpress-3-0/&amp;layout=standard&amp;show_faces=true&amp;width=260&amp;action=like&amp;colorscheme=light' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:260px; height:26px'></iframe></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=cXpcaO9BuWo:cTeoCkE4uBg:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=cXpcaO9BuWo:cTeoCkE4uBg:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/cXpcaO9BuWo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/AyudaWordpress/~3/cXpcaO9BuWo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cientos de temas preparados para WordPress 3.0</title>
		<link>http://feedproxy.google.com/~r/AyudaWordpress/~3/cXpcaO9BuWo/</link>
		<comments>http://feedproxy.google.com/~r/AyudaWordpress/~3/cXpcaO9BuWo/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 18:12:45 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress 3.0]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=8328</guid>
		<description><![CDATA[
Mira que siempre os digo que no hay nada como aprender uno mismo a hacer las cosas. Además, que es muy fácil añadir las funciones básicas que necesita un tema para estar preparado para las novedades de WordPress 3.0: los menús, fondos personalizados, etc.
Pero vaya, que como sé que siempre nos entra la flojera cuando [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ayudawordpress.com/wp-content/uploads/2010/07/wordpress3.png" title="wordpress3" rel="lightbox[8328]"><img class="aligncenter size-medium wp-image-8329" title="wordpress3" src="http://ayudawordpress.com/wp-content/uploads/2010/07/wordpress3-500x280.png" alt="" width="500" height="280" /></a></p>
<p>Mira que siempre os digo que no hay nada como aprender uno mismo a hacer las cosas. Además, que es muy fácil añadir las funciones básicas que necesita un tema para estar preparado para las <a href="http://ayudawordpress.com/todas-las-novedades-de-wordpress-3-0/">novedades de WordPress 3.0</a>: los menús, fondos personalizados, etc.</p>
<p>Pero vaya, que como sé que siempre nos entra la flojera cuando hay una nueva versión, y si otro lo ha hecho ya <strong>¿para qué perder tiempo uno mismo?</strong>, pues he recopilado un buen montón de sitios donde podéis descargar temas ya preparados para todas las funciones nuevas de <strong>WordPress 3.0</strong> y, por supuesto, anteriores …</p>
<ol>
<li>Todos <a href="http://templatic.com/wordpress-themes-store">los temas de Templatic</a> están <a href="http://templatic.com/news/yes-we-are-wordpress-3-0-ready">adaptados a WordPress 3.0</a></li>
<li>Elegant Themes <a href="http://www.elegantthemes.com/blog/theme-changesbug-fixes/all-themes-updated-for-wordpress-3-0">también</a> ha adaptado <a href="http://www.elegantthemes.com/gallery">todos sus maravillosos temas</a> a WordPress 3.0.</li>
<li>Todos los <a href="http://www.site5.com/wordpress-themes/">temas gratuitos de Site5</a>.</li>
<li><a href="http://themeforest.net/searches?term=WordPress+3.0&amp;categories%5Bwordpress%5D=1&amp;type=collections">Algunos de Theme Forest</a>.</li>
<li>Muchos <a href="http://wordpress.org/extend/themes/search.php?q=WordPress+3.0">en el repositorio oficial</a> de WordPress.org.</li>
<li>Todos los <a href="http://www.obox-design.com/themes_shop.cfm">temas de Obox</a>.</li>
<li><a href="http://www.presscoders.com/themes/chunky-theme/">Chunky theme</a>.</li>
<li><a href="http://3oneseven.com/04/tech-9/">Tech 9 theme</a>.</li>
<li><a href="http://www.presscoders.com/themes/twist-of-ten-theme/">Twist of Ten theme</a></li>
<li><a href="http://wpfeed.com/2010/06/wp3theme-free-wordpress-3-0-theme/">WP3Theme</a></li>
<li>Todos los <a href="http://www.woothemes.com/themes/">temas de Woothemes</a></li>
<li><a href="http://www.premiumwordpressthemes.co.uk/theme/studiopress/">StudioPress</a></li>
<li>Todos los <a href="http://themeshift.com/">temas de ThemeShift</a></li>
<li>Todos <a href="http://www.nattywp.com/">los de NattyWP</a></li>
<li>Todos los temas de <a href="http://www.wpnow.com/">WPnow</a></li>
</ol>
<p>Hay una enorme cantidad de temas ya adaptados a WordPress 3.0 como puedes comprobar, y si conoces más nos lo cuentas en los comentarios <img src='http://ayudawordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<!-- PHP 4.x --><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=cXpcaO9BuWo:cTeoCkE4uBg:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=cXpcaO9BuWo:cTeoCkE4uBg:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/cXpcaO9BuWo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/AyudaWordpress/~3/cXpcaO9BuWo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPDocs, toda la API WordPress</title>
		<link>http://feedproxy.google.com/~r/AyudaWordpress/~3/tA1K6bjzqFk/</link>
		<comments>http://feedproxy.google.com/~r/AyudaWordpress/~3/tA1K6bjzqFk/#comments</comments>
		<pubDate>Sat, 01 May 2010 14:41:04 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Avanzado]]></category>
		<category><![CDATA[Codex]]></category>
		<category><![CDATA[Experto]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Tutoriales / Trucos]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=7809</guid>
		<description><![CDATA[
WPDocs es un sitio impresionantemente bueno y útil, tienes un buscador predictivo que va mostrando resultados mientras escribes, y comprende toda la documentación de funciones y hooks de WordPress. Como puedes adivinar, un recurso genial para desarrolladores y usuarios avanzados.
Guárdalo en favoritos, es genial, en cada función encontrada te muestra ejemplos y un enlace a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ayudawordpress.com/wp-content/uploads/2010/05/wpdocs.png" title="wpdocs" rel="lightbox[7809]"><img src="http://ayudawordpress.com/wp-content/uploads/2010/05/wpdocs-500x287.png" alt="" title="wpdocs" width="500" height="287" class="aligncenter size-medium wp-image-7810" /></a></p>
<p><a href="http://wpdocs.labs.thedextrousweb.com/">WPDocs</a> es un sitio impresionantemente bueno y útil, tienes un buscador predictivo que va mostrando resultados mientras escribes, y comprende <strong>toda la documentación de funciones y hooks de WordPress</strong>. Como puedes adivinar, un <strong>recurso genial para desarrolladores</strong> y usuarios avanzados.</p>
<p>Guárdalo en favoritos, es genial, en cada función encontrada te muestra ejemplos y un enlace a la documentación completa en el <strong>Codex</strong>.</p>



¿Te gustó este post? ¡Compártelo!


	<a rel="nofollow"  href="http://bitacoras.com/anotaciones/http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="Bitacoras.com"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/bitacoras.png" title="Bitacoras.com" alt="Bitacoras.com" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="TwitThis"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/twitter.png" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F&amp;t=WPDocs%2C%20toda%20la%20API%20WordPress" title="Facebook"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://meneame.net/submit.php?url=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="Meneame"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F&amp;title=WPDocs%2C%20toda%20la%20API%20WordPress&amp;annotation=%0D%0A%0D%0AWPDocs%20es%20un%20sitio%20impresionantemente%20bueno%20y%20%C3%BAtil%2C%20tienes%20un%20buscador%20predictivo%20que%20va%20mostrando%20resultados%20mientras%20escribes%2C%20y%20comprende%20toda%20la%20documentaci%C3%B3n%20de%20funciones%20y%20hooks%20de%20WordPress.%20Como%20puedes%20adivinar%2C%20un%20recurso%20genial%20para%20d" title="Google Bookmarks"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F&amp;title=WPDocs%2C%20toda%20la%20API%20WordPress&amp;notes=%0D%0A%0D%0AWPDocs%20es%20un%20sitio%20impresionantemente%20bueno%20y%20%C3%BAtil%2C%20tienes%20un%20buscador%20predictivo%20que%20va%20mostrando%20resultados%20mientras%20escribes%2C%20y%20comprende%20toda%20la%20documentaci%C3%B3n%20de%20funciones%20y%20hooks%20de%20WordPress.%20Como%20puedes%20adivinar%2C%20un%20recurso%20genial%20para%20d" title="del.icio.us"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F&amp;title=WPDocs%2C%20toda%20la%20API%20WordPress" title="Live"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="Technorati"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://ping.fm/ref/?link=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F&amp;title=WPDocs%2C%20toda%20la%20API%20WordPress&amp;body=%0D%0A%0D%0AWPDocs%20es%20un%20sitio%20impresionantemente%20bueno%20y%20%C3%BAtil%2C%20tienes%20un%20buscador%20predictivo%20que%20va%20mostrando%20resultados%20mientras%20escribes%2C%20y%20comprende%20toda%20la%20documentaci%C3%B3n%20de%20funciones%20y%20hooks%20de%20WordPress.%20Como%20puedes%20adivinar%2C%20un%20recurso%20genial%20para%20d" title="Ping.fm"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="Wikio"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio" alt="Wikio" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/getpf?url=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="Turn this article into a PDF!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/pdf.png" title="Turn this article into a PDF!" alt="Turn this article into a PDF!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=WPDocs%2C%20toda%20la%20API%20WordPress&amp;body=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="E-mail this story to a friend!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fayudawordpress.com%2Fwpdocs-toda-la-api-wordpress%2F" title="Print this article!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a>


<br/><br/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=tA1K6bjzqFk:KrT15RR3gT0:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=tA1K6bjzqFk:KrT15RR3gT0:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/tA1K6bjzqFk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/AyudaWordpress/~3/tA1K6bjzqFk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>35 Funciones útiles para functions.php en Wordpress</title>
		<link>http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/</link>
		<comments>http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 22:02:22 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[google docs]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[taxonomía]]></category>
		<category><![CDATA[Tutoriales / Trucos]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=7607</guid>
		<description><![CDATA[
Normalmente cualquier tema de Wordpress que utilicemos, ya sea externo o creado por nosotros, tiene un archivo functions.php  donde se agrupan las funciones que va a utilizar nuestro tema. Su utilidad puede ser de lo más variada, desde cambiar comportamientos por defecto de Wordpress a funciones útiles típicas de cualquier aplicación en PHP.
Seguramente cualquier [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayudawordpress.com/wp-content/uploads/2010/04/wordpress-matrix-code.jpg" alt="" title="wordpress matrix code" width="380" height="257" class="aligncenter size-full wp-image-7631" /></p>
<p>Normalmente cualquier tema de Wordpress que utilicemos, ya sea externo o creado por nosotros, tiene un archivo <strong>functions.php </strong> donde se agrupan las funciones que va a utilizar nuestro tema. Su utilidad puede ser de lo más variada, desde cambiar comportamientos por defecto de Wordpress a funciones útiles típicas de cualquier aplicación en PHP.</p>
<p>Seguramente cualquier diseñador que utilice Wordpress con frecuencia tiene <strong>una serie de funciones que utiliza en todos sus diseños</strong>. Yo suelo utilizar un tema vacío (<a href="http://elliotjaystocks.com/blog/free-starkers-wordpress-theme/" title="Starkers">Starkers</a>) que me permite empezar todo de cero, dándome mayor maniobrabilidad. Pero incluyo ciertas variaciones propias, entre ellas mis propios archivos <code>functions.php</code> y <code>style.css</code>.</p>
<p>Estuve pensando en un principio en incluir en este artículo mi archivo functions.php, en el que incluyo una serie de funciones de uso frecuente. Pero luego decidí ampliar el artículo incluyendo funciones sugeridas por distintos autores, para lograr una cobertura mucho más amplia de funciones útiles. Empezamos.</p>
<p><span id="more-7607"></span></p>
<h3>Cargar jQuery</h3>
<p>Mediante esta función nos aseguramos de que se incluye una copia de jQuery. Se obtiene desde los servidores de Google para ahorrarnos algo de ancho de banda y para conseguir en teoría más rapidez para el usuario. Si tenemos alguna función relacionada con jQuery debería ir debajo de esta.</p>
<div class="igBar"><span id="lphp-51"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-51'); return false;">Clic para 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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !is_admin<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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;wp_deregister_script<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'jquery'</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;wp_register_script<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'jquery'</span>, <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#000000; font-weight:bold;">false</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;wp_enqueue_script<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'jquery'</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; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Crear Widgets</h3>
<p>Esta función seguro que es de sobra conocida y viene además en la práctica totalidad de temas, incluso en starkers. Se puede adaptar en función del nombre del widget, y de lo que queramos que aparezca antes y después del widget.</p>
<div class="igBar"><span id="lphp-52"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-52'); return false;">Clic para 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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'register_sidebar'</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; register_sidebar<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;">&#40;</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; &nbsp; &nbsp; <span style="color:#FF0000;">'name'</span> =&gt; <span style="color:#FF0000;">'Sidebar Widgets'</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; &nbsp; &nbsp; <span style="color:#FF0000;">'id'</span>&nbsp; &nbsp;=&gt; <span style="color:#FF0000;">'sidebar-widgets'</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; &nbsp; &nbsp; <span style="color:#FF0000;">'description'</span>&nbsp; &nbsp;=&gt; <span style="color:#FF0000;">'These are widgets for the sidebar.'</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; &nbsp; &nbsp; <span style="color:#FF0000;">'before_widget'</span> =&gt; <span style="color:#FF0000;">'&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'after_widget'</span>&nbsp; =&gt; <span style="color:#FF0000;">'&lt;/div&gt;'</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; &nbsp; &nbsp; <span style="color:#FF0000;">'before_title'</span>&nbsp; =&gt; <span style="color:#FF0000;">'&lt;h2&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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'after_title'</span>&nbsp; &nbsp;=&gt; <span style="color:#FF0000;">'&lt;/h2&gt;'</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:#006600; font-weight:bold;">&#41;</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; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Taxonomías</h3>
<p>El uso de esta función lo he explicado en <a href="http://www.emenia.es/taxonomias-en-wordpress/" title="Ir al artículo">este artículo sobre cómo crear Taxonomías</a> en mi blog.</p>
<div class="igBar"><span id="lphp-53"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-53'); return false;">Clic para 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:#000000; font-weight:bold;">function</span> taxonomias_propias<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;">&#123;</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; register_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'artista'</span>, <span style="color:#FF0000;">'post'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'hierarchical'</span> =&gt; <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#FF0000;">'label'</span> =&gt; <span style="color:#FF0000;">'Artista'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'query_var'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">'rewrite'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</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; register_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'album'</span>, <span style="color:#FF0000;">'post'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'hierarchical'</span> =&gt; <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#FF0000;">'label'</span> =&gt; <span style="color:#FF0000;">'Album'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'query_var'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">'rewrite'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</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; register_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'genero'</span>, <span style="color:#FF0000;">'post'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'hierarchical'</span> =&gt; <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#FF0000;">'label'</span> =&gt; <span style="color:#FF0000;">'Género'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'query_var'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">'rewrite'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</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; register_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'autor'</span>, <span style="color:#FF0000;">'post'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'hierarchical'</span> =&gt; <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#FF0000;">'label'</span> =&gt; <span style="color:#FF0000;">'Autor'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'query_var'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">'rewrite'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</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; register_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'duracion'</span>, <span style="color:#FF0000;">'post'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'hierarchical'</span> =&gt; <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#FF0000;">'label'</span> =&gt; <span style="color:#FF0000;">'Duración'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'query_var'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">'rewrite'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</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; register_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'fecha'</span>, <span style="color:#FF0000;">'post'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'hierarchical'</span> =&gt; <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#FF0000;">'label'</span> =&gt; <span style="color:#FF0000;">'Fecha'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'query_var'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">'rewrite'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</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; <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;">&nbsp; &nbsp; add_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'init'</span>, <span style="color:#FF0000;">'taxonomias_propias'</span>, <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Crear Taxonomías en páginas</h3>
<p>La anterior función creaba taxonomías en las entradas de nuestro blog. Veremos cómo crearlas en las <em>páginas</em>.<br />
Fuente: <a href="http://justintadlock.com/archives/2009/11/09/excerpts-and-taxonomies-for-pages-in-wordpress-2-9" title="Ir al artículo">http://justintadlock.com/archives/2009/11/09/excerpts-and-taxonomies-for-pages-in-wordpress-2-9</a><br />
Hay que recordar que en Wordpress 2.9 las Taxonomías no admiten jerarquización, como las categorías. Como ejemplo, creamos una Taxonomía para páginas llamada "people":</p>
<div class="igBar"><span id="lphp-54"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-54'); return false;">Clic para 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;">register_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'people'</span>, <span style="color:#FF0000;">'page'</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:#FF0000;">'hierarchical'</span> =&gt; <span style="color:#000000; font-weight:bold;">false</span>, <span style="color:#FF0000;">'label'</span> =&gt; <span style="color:#FF0000;">'People'</span>, <span style="color:#FF0000;">'query_var'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span>, <span style="color:#FF0000;">'rewrite'</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#41;</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;</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;">add_action<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'admin_menu'</span>, <span style="color:#FF0000;">'my_page_taxonomy_meta_boxes'</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;</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;">function</span> my_page_taxonomy_meta_boxes<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;">&#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;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span> get_object_taxonomies<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'page'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$tax_name</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !is_taxonomy_hierarchical<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tax_name</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></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; &nbsp; <span style="color:#0000FF;">$tax</span> = get_taxonomy<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tax_name</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; &nbsp; &nbsp; add_meta_box<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">"tagsdiv-{$tax_name}"</span>, <span style="color:#0000FF;">$tax</span>-&gt;<span style="color:#006600;">label</span>, <span style="color:#FF0000;">'post_tags_meta_box'</span>, <span style="color:#FF0000;">'page'</span>, <span style="color:#FF0000;">'side'</span>, <span style="color:#FF0000;">'core'</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:#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;">&nbsp; &nbsp; <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>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Crear Campos Personalizados Globales</h3>
<p>Esta función la he descubierto no hace mucho. Fuente: <a href="http://digwp.com/2009/09/global-custom-fields-take-two/" title="Ir al artículo">http://digwp.com/2009/09/global-custom-fields-take-two/</a>. Como sabemos, los campos personalizados normales (Custom Fields) en Wordpress están asignados a cada entrada o a cada página. Es decir, que un dato que se repita por toda la web habría que estar incorporándolo en cada entrada, en cada página, etc.. Gracias a la función que veremos a continuación podemos crear Campos Personalizados Globales, disponibles en todas las páginas y entradas. Su ubicación es un poco extraña, ya que una vez creados aparecen en el menú de opciones dentro del administrador. </p>
<div class="igBar"><span id="lphp-55"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-55'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-55">
<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;">add_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'admin_menu'</span>, <span style="color:#FF0000;">'add_gcf_interface'</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;</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;">function</span> add_gcf_interface<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;">&#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;">&nbsp; &nbsp; add_options_page<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Global Custom Fields'</span>, <span style="color:#FF0000;">'Global Custom Fields'</span>, <span style="color:#FF0000;">'8'</span>, <span style="color:#FF0000;">'functions'</span>, <span style="color:#FF0000;">'editglobalcustomfields'</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:#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;">&nbsp;</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;">function</span> editglobalcustomfields<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;">&#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;">&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;div <span style="color:#000000; font-weight:bold;">class</span>=<span style="color:#FF0000;">'wrap'</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;">&nbsp; &nbsp; &lt;h2&gt;Global Custom Fields&lt;/h2&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;form method=<span style="color:#FF0000;">"post"</span> action=<span style="color:#FF0000;">"options.php"</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;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> wp_nonce_field<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'update-options'</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;</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;p&gt;&lt;strong&gt;My Name:&lt;/strong&gt;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;input type=<span style="color:#FF0000;">"text"</span> name=<span style="color:#FF0000;">"myname"</span> size=<span style="color:#FF0000;">"45"</span> value=<span style="color:#FF0000;">"&lt;?php echo get_option('myname'); ?&gt;"</span> /&gt;&lt;/p&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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;p&gt;&lt;strong&gt;Amazon ID:&lt;/strong&gt;&lt;br /&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;input type=<span style="color:#FF0000;">"text"</span> name=<span style="color:#FF0000;">"amazonid"</span> size=<span style="color:#FF0000;">"45"</span> value=<span style="color:#FF0000;">"&lt;?php echo get_option('amazonid'); ?&gt;"</span> /&gt;&lt;/p&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&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; &lt;p&gt;&lt;strong&gt;Today<span style="color:#FF0000;">'s Featured Website:&lt;/strong&gt;&lt;br /&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;input type=&quot;text&quot; name=&quot;todaysite&quot; size=&quot;45&quot; value=&quot;&lt;?php echo get_option('</span>todaysite<span style="color:#FF0000;">'); ?&gt;&quot; /&gt;&lt;/p&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;p&gt;&lt;strong&gt;Welcome Text:&lt;/strong&gt;&lt;br /&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;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;textarea name=&quot;welcomemessage&quot; cols=&quot;100%&quot; rows=&quot;7&quot;&gt;&lt;?php echo get_option('</span>welcomemessage<span style="color:#FF0000;">'); ?&gt;&lt;/textarea&gt;&lt;/p&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></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:#FF0000;">&nbsp; &nbsp; &lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Update Options&quot; /&gt;&lt;/p&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></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:#FF0000;">&nbsp; &nbsp; &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;update&quot; /&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;input type=&quot;hidden&quot; name=&quot;page_options&quot; value=&quot;myname,amazonid,todaysite,welcomemessage&quot; /&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;/form&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;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;/div&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;?php } ?&gt; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Para usarlo simplemente hay que escribir echo get_option('welcomemessage');  o echo get_option('todaysite'); etc (relacionados con el ejemplo de la función)</p>
<h3>Campos personalizados (Custom Fields)</h3>
<p>Fuente: <a href="http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/" title="Ir al artículo">http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/</a><br />
Esta función permite simplificar el uso de los Campos Personalizados (Custom Fields) que  se pueden incorporar en cada entrada o página. Su uso es:<br />
get_custom_field_value( Custom Field Key, Print ); donde:<br />
1. Custom Field Key: ( cadena ) – Nombre del Campo Personalizado que quieres obtener<br />
2. Print: ( booleano, falso por defecto ) – escribe o devuelve el valor.<br />
Ejemplo:</p>
<div class="igBar"><span id="lphp-56"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-56'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-56">
<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:#FF9933; font-style:italic;">// gets the value of the custom field featured_image and prints it.</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> <a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'get_custom_field_value'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> get_custom_field_value<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'featured_image'</span>, <span style="color:#000000; font-weight:bold;">true</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;">&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;">&lt;/pre&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Y ahora la función:</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;pre lang=<span style="color:#FF0000;">"php"</span> line=<span style="color:#FF0000;">"1"</span>&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;">function</span> get_custom_field_value<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$szKey</span>, <span style="color:#0000FF;">$bPrint</span> = <span style="color:#000000; font-weight:bold;">false</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:#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; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$post</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:#0000FF;">$szValue</span> = get_post_meta<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">ID</span>, <span style="color:#0000FF;">$szKey</span>, <span style="color:#000000; font-weight:bold;">true</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; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$bPrint</span> == <span style="color:#000000; font-weight:bold;">false</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">return</span> <span style="color:#0000FF;">$szValue</span>; <span style="color:#616100;">else</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$szValue</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Permitir comentarios anidados (threaded comments)</h3>
<p>Para activar los comentarios anidados hay que añadir un código dentro del <em>head</em> de tu tema justo antes de <em>wp_head</em>. Este código se puede incorporar a functions.php, lo que ayuda a limpiar un poco la zona del <em>head</em>. Precisa que la función que incorpora jQuery esté ubicada por encima de esta dentro de functions.php<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-57"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-57'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-57">
<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> enable_threaded_comments<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;">&#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;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!is_admin<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></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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>is_singular<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> AND comments_open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> AND <span style="color:#006600; font-weight:bold;">&#40;</span>get_option<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'thread_comments'</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</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; &nbsp; &nbsp; wp_enqueue_script<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'comment-reply'</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:#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;">add_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'get_header'</span>, <span style="color:#FF0000;">'enable_threaded_comments'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Eliminar basura del área <em>head</em></h3>
<p>Según algunos autores, Wordpress ubica gran cantidad de código no muy útil en el <em>head</em>. Cosas como el número de versión, y enlaces WLW, RSD...<br />
Para limpiar todo esto basta con esta función.<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-58"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-58'); return false;">Clic para 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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'rsd_link'</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'wp_generator'</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'feed_links'</span>, <span style="color:#CC66CC;color:#800000;">2</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'index_rel_link'</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'wlwmanifest_link'</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'feed_links_extra'</span>, <span style="color:#CC66CC;color:#800000;">3</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'start_post_rel_link'</span>, <span style="color:#CC66CC;color:#800000;">10</span>, <span style="color:#CC66CC;color:#800000;">0</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'parent_post_rel_link'</span>, <span style="color:#CC66CC;color:#800000;">10</span>, <span style="color:#CC66CC;color:#800000;">0</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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'adjacent_posts_rel_link'</span>, <span style="color:#CC66CC;color:#800000;">10</span>, <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Añadir Google Analytics al <em>footer</em></h3>
<p>Esta función nos permite añadir de una manera sencilla Google Analytics.<br />
Sólo requiere cambiar UA-XXXXX-X por tu código (el que te provee Google Analytics). Esta función utiliza el sistema ga.js, pero se puede cambiar a cualquiera de los otros que ofrece Analytics.<br />
Fuente:  <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-59"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-59'); return false;">Clic para 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:#000000; font-weight:bold;">function</span> add_google_analytics<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;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;script src=&quot;http://www.google-analytics.com/ga.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&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; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;script type=&quot;text/javascript&quot;&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'var pageTracker = _gat._getTracker(&quot;UA-XXXXX-X&quot;);'</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; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'pageTracker._trackPageview();'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;/script&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;"><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_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_footer'</span>, <span style="color:#FF0000;">'add_google_analytics'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Ajustar el tamaño del extracto</h3>
<p>Como sabemos, podemos mostrar el contenido completo de un artículo o su extracto. El extracto tiene un límite de 55 palabras. Esta función te permitirá especificar cualquier longitud (cambia el número 20 a la cifra que quieras).<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-60"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-60'); return false;">Clic para 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;">function</span> custom_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> <span style="color:#CC66CC;color:#800000;">20</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:#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;">'custom_excerpt_length'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Reducir el tamaño del texto</h3>
<p>Función para reducir el número de caracteres de una entrada.<br />
Fuente: <a href="http://www.mattvarone.com/wordpress/functionsphp-wordpress-themes/" title="Ir al artículo">http://www.mattvarone.com/wordpress/functionsphp-wordpress-themes/</a><br />
Ejemplo de uso:<br />
1. Caracteres: ( número int, por defecto 250 ) – Número de caracteres que se muestran.<br />
2. Cola: ( cadena, por defecto "…" ) – Texto a mostrar tras el texto cortado.<br />
3. Mostrar: ( booleano, por defecto: true ) – Imprime la lista o lo devuelve para PHP.</p>
<div class="igBar"><span id="lphp-61"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-61'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-61">
<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:#FF9933; font-style:italic;">// wordpress loop</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;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span>have_posts<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> : the_post<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;">&nbsp; &nbsp; &nbsp; &lt;h1&gt;the_title<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; &lt;/h1&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;div <span style="color:#000000; font-weight:bold;">class</span>=<span style="color:#FF0000;">"entry"</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:#FF9933; font-style:italic;">// se cortará el texto al llegar a los 150 caracteres</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> <a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'shorten_text'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> shorten_text<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#CC66CC;color:#800000;">150</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;">&lt;/div&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">endwhile</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La función que va en functions.php es:</p>
<div class="igBar"><span id="lphp-62"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-62'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-62">
<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> shorten_text<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iChars</span> = <span style="color:#CC66CC;color:#800000;">250</span>, <span style="color:#0000FF;">$szTail</span> = <span style="color:#FF0000;">"..."</span>, <span style="color:#0000FF;">$bPrint</span> = <span style="color:#000000; font-weight:bold;">true</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:#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/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$post</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;">$szText</span> = <a href="http://www.php.net/strip_tags"><span style="color:#000066;">strip_tags</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/trim"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_content</span> <span style="color:#006600; font-weight:bold;">&#41;</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:#0000FF;">$szText</span> = <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$szText</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$iChars</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:#0000FF;">$szText</span> = <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$szText</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <a href="http://www.php.net/strrpos"><span style="color:#000066;">strrpos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$szText</span> , <span style="color:#FF0000;">' '</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#0000FF;">$szTail</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;">apply_filters<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'the_excerpt'</span>, <span style="color:#0000FF;">$szText</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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$bPrint</span> == <span style="color:#000000; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$szText</span>; <span style="color:#616100;">else</span> <span style="color:#616100;">return</span> <span style="color:#0000FF;">$szText</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Limitar el número de palabras</h3>
<p>Ejemplo de uso</p>
<div class="igBar"><span id="lphp-63"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-63'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-63">
<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;">$longtext</span>= get_the_excerpt<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;">// Uso con el extracto, aunque se puede hacer con el contenido completo.</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;">$permalink</span> = get_permalink<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">ID</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:#0000FF;">$shorttext</span>=limit_words<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$longtext</span>, <span style="color:#CC66CC;color:#800000;">13</span>,<span style="color:#FF0000;">'&amp;#91;...&amp;#93;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;'</span>. <span style="color:#0000FF;">$permalink</span> . <span style="color:#FF0000;">'&quot; class=&quot;mas&quot; title=&quot;Ir al art&amp;iacute;culo&quot;&gt;M&amp;aacute;s&amp;raquo;&lt;/a&gt;'</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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;p&gt;'</span> . <span style="color:#0000FF;">$shorttext</span> . <span style="color:#FF0000;">'&lt;/p&gt;'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La función que va en functions.php es:</p>
<div class="igBar"><span id="lphp-64"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-64'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-64">
<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> limit_words<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$str</span>, <span style="color:#0000FF;">$num</span>, <span style="color:#0000FF;">$append_str</span>=<span style="color:#FF0000;">''</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:#0000FF;">$words</span> = <a href="http://www.php.net/preg_split"><span style="color:#000066;">preg_split</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'/[<span style="color:#000099; font-weight:bold;">\s</span>]+/'</span>, <span style="color:#0000FF;">$str</span>, -<span style="color:#CC66CC;color:#800000;">1</span>, PREG_SPLIT_OFFSET_CAPTURE <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:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/isset"><span style="color:#000066;">isset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$words</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$num</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</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></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:#0000FF;">$str</span> = <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$str</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$words</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$num</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#0000FF;">$append_str</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:#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;">&nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color:#000066;">unset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$words</span>, <span style="color:#0000FF;">$num</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; <span style="color:#616100;">return</span> <a href="http://www.php.net/trim"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$str</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Cadena de puntos suspensivos personalizadas para el Extracto en Wordpress 2.9+</h3>
<p>En los extractos, estos acaban por defecto en "[...]". Esto lo podemos cambiar a lo que queramos con la función que veremos a continuación. Símplemente reemplaza los puntos suspensivos por la cadena de texto que prefieras.<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a>.</p>
<div class="igBar"><span id="lphp-65"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-65'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-65">
<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> custom_excerpt_more<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$more</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> <span style="color:#FF0000;">'...'</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:#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_more'</span>, <span style="color:#FF0000;">'custom_excerpt_more'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Añadir un favicon a tu blog</h3>
<p>Con esta función podrás emplazar de manera muy simple un favicon para tu web. Símplemente sube el icono al directorio raíz (el directorio lo puedes cambiar en la función), escribe la función en functions.php y se añadirá automáticamente la línea necesaria en el <em>head</em> de tu página siempre y cuando tengas wp_head en tu fichero head.php de tu tema.<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-66"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-66'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-66">
<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> blog_favicon<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;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;link rel=&quot;Shortcut Icon&quot; type=&quot;image/x-icon&quot; href=&quot;'</span>.get_bloginfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wpurl'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">'/favicon.ico&quot; /&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;"><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_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'blog_favicon'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Añadir un favicon a tu área de administración</h3>
<p>Igual que el anterior, pero en vez de para la web, esta vez es para tu área de administración. Crea un icono y súbelo al directorio /images/ (puedes cambiar el directorio si quieres)<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-67"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-67'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-67">
<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> admin_favicon<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;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;link rel=&quot;Shortcut Icon&quot; type=&quot;image/x-icon&quot; href=&quot;'</span>.get_bloginfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'stylesheet_directory'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">'/images/favicon.png&quot; /&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;"><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_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'admin_head'</span>, <span style="color:#FF0000;">'admin_favicon'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Logo personalizado en el login de admin</h3>
<p>Fuente: <a href="http://www.chrisdecker.com/wordpress/customize-your-wordpress-admin-panel-login-logo/" title="Ir al artículo">http://www.chrisdecker.com/wordpress/customize-your-wordpress-admin-panel-login-logo/</a><br />
Puedes cambiar el logo de Wordpress que sale en el login de la página de administración de tu web por otro de tu elección con esta función.  Símplemente crea una imagen no mayor de 328 x 84 y súbela al directorio /images/ de tu servidor con el nombre que pongas en la función (en este caso "customlogofilename.png". Si no lo tuvieras créalo. El código a incluir en functions.php es:</p>
<div class="igBar"><span id="lphp-68"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-68'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-68">
<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> my_custom_login_logo<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;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;style type=&quot;text/css&quot;&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;"><span style="color:#FF0000;">&nbsp; &nbsp; &nbsp; &nbsp; h1 a { background-image:url(/images/customlogofilename.png) !important; }</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp; &lt;/style&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;"><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;">&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;">add_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'login_head'</span>, <span style="color:#FF0000;">'my_custom_login_logo'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Eliminar el mensaje de actualización de Wordpress</h3>
<p>Permite eliminar el a veces molesto mensaje que aparece en el panel de administración que nos pide que actualicemos nuestra versión de Wordpress.<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-69"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-69'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-69">
<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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!current_user_can<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'edit_users'</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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; add_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'init'</span>, <a href="http://www.php.net/create_function"><span style="color:#000066;">create_function</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'$a'</span>, <span style="color:#FF0000;">"remove_action('init', 'wp_version_check');"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#CC66CC;color:#800000;">2</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; add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'pre_option_update_core'</span>, <a href="http://www.php.net/create_function"><span style="color:#000066;">create_function</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'$a'</span>, <span style="color:#FF0000;">"return null;"</span><span style="color:#006600; font-weight:bold;">&#41;</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Eliminar el mensaje de error en la pantalla de login de admin</h3>
<p>Cuando ponemos mal la contraseña un mensaje nos dice que lo que está mal es la contraseña, lo cual no es muy seguro al dar pistas de cual es el error. Con este código en functions.php eliminamos ese problema.</p>
<div class="igBar"><span id="lphp-70"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-70'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-70">
<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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'login_errors'</span>,<a href="http://www.php.net/create_function"><span style="color:#000066;">create_function</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'$a'</span>, <span style="color:#FF0000;">"return null;"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Forzar <em>wp-admin</em> a usar SSL</h3>
<p>Util para los que tengan un certificado SSL, ya sea propio o compartido. Es más seguro acceder a el área de administración a través de SSL.</p>
<div class="igBar"><span id="lphp-71"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-71'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-71">
<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;"><a href="http://www.php.net/define"><span style="color:#000066;">define</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'FORCE_SSL_ADMIN'</span>, <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>ID de la Categoría en Body y en la clase de la entrada (post)</h3>
<p>Por defecto, WordPress no incluye el ID de la categoría de la entrada actual en <em>body_class</em> ni en <em>post_class</em>. Esta función permite añadirlo.<br />
Fuente: <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-72"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-72'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-72">
<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> category_id_class<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$classes</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; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$post</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:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>get_the_category<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">ID</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$category</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:#0000FF;">$classes</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'cat-'</span> . <span style="color:#0000FF;">$category</span>-&gt;<span style="color:#006600;">cat_ID</span> . <span style="color:#FF0000;">'-id'</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:#616100;">return</span> <span style="color:#0000FF;">$classes</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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'post_class'</span>, <span style="color:#FF0000;">'category_id_class'</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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'body_class'</span>, <span style="color:#FF0000;">'category_id_class'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Obtener el ID de la primera categoría</h3>
<p>Otra función útil cuando tenemos diferentes categorías. Permite obtener el ID de la primera categoría de la entrada actual.<br />
Para usarlo símplemente usa <em>get_first_category_ID(); </em> en el archivo template de tu tema.<br />
Fuente:  <a href="http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/" title="Ir al artículo">http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/</a></p>
<div class="igBar"><span id="lphp-73"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-73'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-73">
<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> get_first_category_ID<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;">&#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:#0000FF;">$category</span> = get_the_category<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;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$category</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>-&gt;<span style="color:#006600;">cat_ID</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>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Obtener los comentarios más recientes</h3>
<p>Con esta función obtenemos los comentarios más recientes.<br />
Para usarlo escribimos <em>dp_recent_comments(6);</em> en el template de nuestro tema, donde el número entre paréntesis es el número de comentarios que queremos que aparezcan.<br />
Fuente: <a href="http://www.wplancer.com/how-to-display-recent-comments-without-using-a-plugin-or-widget/">http://www.wplancer.com/how-to-display-recent-comments-without-using-a-plugin-or-widget/</a></p>
<div class="igBar"><span id="lphp-74"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-74'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-74">
<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> dp_recent_comments<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$no_comments</span> = <span style="color:#CC66CC;color:#800000;">10</span>, <span style="color:#0000FF;">$comment_len</span> = <span style="color:#CC66CC;color:#800000;">35</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; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$wpdb</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:#0000FF;">$request</span> = <span style="color:#FF0000;">"SELECT * FROM $wpdb-&gt;comments"</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:#0000FF;">$request</span> .= <span style="color:#FF0000;">" JOIN $wpdb-&gt;posts ON ID = comment_post_ID"</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:#0000FF;">$request</span> .= <span style="color:#FF0000;">" WHERE comment_approved = '1' AND post_status = 'publish' AND post_password =''"</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:#0000FF;">$request</span> .= <span style="color:#FF0000;">" ORDER BY comment_date DESC LIMIT $no_comments"</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:#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:#0000FF;">$request</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; <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:#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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</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> <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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/ob_start"><span style="color:#000066;">ob_start</span></a><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;">&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; &nbsp; &nbsp; &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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=<span style="color:#FF0000;">"&lt;?php echo get_permalink( $comment-&gt;comment_post_ID ) . '#comment-' . $comment-&gt;comment_ID; ?&gt;"</span>&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> dp_get_author<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span>:&lt;/a&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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <a href="http://www.php.net/strip_tags"><span style="color:#000066;">strip_tags</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>apply_filters<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'get_comment_text'</span>, <span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_content</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$comment_len</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-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; &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; <span style="color:#000000; font-weight:bold;">&lt;?php</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; <a href="http://www.php.net/ob_end_flush"><span style="color:#000066;">ob_end_flush</span></a><span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; <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;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</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; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;li&gt;'</span>.__<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'No comments'</span>, <span style="color:#FF0000;">'banago'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">''</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:#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;">function</span> dp_get_author<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</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:#0000FF;">$author</span> = <span style="color:#FF0000;">""</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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_author</span><span style="color:#006600; font-weight:bold;">&#41;</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:#0000FF;">$author</span> = __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Anonymous'</span>, <span style="color:#FF0000;">'banago'</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; <span style="color:#616100;">else</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:#0000FF;">$author</span> = <span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_author</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:#616100;">return</span> <span style="color:#0000FF;">$author</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>
</ol>
</div>
</div>
</div>
<p></p>
<p>Como vemos en:</p>
<div class="igBar"><span id="lphp-75"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-75'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-75">
<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> dp_recent_comments<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$no_comments</span> = <span style="color:#CC66CC;color:#800000;">10</span>, <span style="color:#0000FF;">$comment_len</span> = <span style="color:#CC66CC;color:#800000;">35</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
tenemos por defecto 10 comentarios con una longitud de 35 caracteres, que podemos cambiar.</p>
<h3>Crear un código corto (shortcode) para el enlace de portada</h3>
<p>Esta función convierte el <em>shortcode</em>  [home] a un enlace a tu página de inicio. Para usarlo símplemente escribe [home] en cualquier entrada de tu blog y Wordpress ejecutará la función <em>myHomePage</em> y mostrará el enlace a la<em> home</em>. Puedes probarla para crear otros enlaces. Tienes que cambiar domain.tld por la URL de tu Home, etc..</p>
<div class="igBar"><span id="lphp-76"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-76'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-76">
<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> myHomePage<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;">&#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;">return</span> <span style="color:#FF0000;">'&lt;a href=&quot;http://domain.tld/&quot;</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:#FF0000;">title=&quot;My Website Homepage&quot;&gt;My Homepage&lt;/a&gt;'</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;">add_shortcode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'home'</span>, <span style="color:#FF0000;">'myHomePage'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Eliminar la versión de Wordpress del header y del feed</h3>
<div class="igBar"><span id="lphp-77"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-77'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-77">
<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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'the_generator'</span>,<span style="color:#FF0000;">'killVersion'</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;">function</span> killVersion<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;">&#123;</span> <span style="color:#616100;">return</span> <span style="color:#FF0000;">''</span>; <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;">remove_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_head'</span>, <span style="color:#FF0000;">'wp_generator'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Limpiar pigbacks y trackbacks de los comentarios</h3>
<div class="igBar"><span id="lphp-78"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-78'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-78">
<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> cleanPings<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>, <span style="color:#0000FF;">$args</span>, <span style="color:#0000FF;">$depth</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:#0000FF;">$GLOBALS</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'comment'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$comment</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;'</span>.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;/li&gt;'</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>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para usarlo, normalmente en comments.php:</p>
<div class="igBar"><span id="lphp-79"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-79'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-79">
<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;">wp_list_comments<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'type=pings&amp;callback=cleanPings'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Contar el número de comentarios (sin trackbacks ni pingbacks)</h3>
<p>Filtramos la función <em>comments_number</em> de Wordpress para obtener sólo el número de comentarios, ya que normalmente esta función incluye también pingbacks y trackbacks.<br />
Para usarlo símplemente pon <em>comments_number()</em> donde quieras mostrar el número.</p>
<div class="igBar"><span id="lphp-80"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-80'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-80">
<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> countComments<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$count</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;"><a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$wp_query</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;">return</span> <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$wp_query</span>-&gt;<span style="color:#006600;">comments_by_type</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'comment'</span><span style="color:#006600; font-weight:bold;">&#93;</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:#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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'get_comments_number'</span>, <span style="color:#FF0000;">'countComments'</span>, <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Activar miniaturas (thumnails), en Wordpress 2.9+</h3>
<p>Podéis ver cómo funciona en este artículo de mi blog: <a href="http://www.emenia.es/nuevo-en-wordpress-2-9-miniaturas-de-entrada-post-thumbnails/" title="Ir a Emenia ver artículo">http://www.emenia.es/nuevo-en-wordpress-2-9-miniaturas-de-entrada-post-thumbnails/</a>.</p>
<p>Para usarlo símplemente hay que poner <em>the_post_thumbnail();</em> dentro del loop.</p>
<div class="igBar"><span id="lphp-81"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-81'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-81">
<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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'add_theme_support'</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> add_theme_support<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'post-thumbnails'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Obtener y mostrar la primera imagen de una entrada</h3>
<p>Con esta función obtenemos la primera imagen que se encuentre dentro del contenido de una entrada.<br />
Fuente: <a href="http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/" title="Ir al artículo">http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/</a><br />
Los parámetros son:<br />
1. Número de Imagen: Número de la imagen que deseas obtener (por defecto 0, que es por el número que empieza).<br />
2. Mostrar: ( booleano, por defecto <em>false</em> ) – Muestra o devuelve el valor para php.<br />
Uso de la función:</p>
<div class="igBar"><span id="lphp-82"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-82'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-82">
<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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'get_post_image'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> get_post_image<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#000000; font-weight:bold;">true</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;">&lt;/ul&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y la función, que irá en functions.php, es:</p>
<div class="igBar"><span id="lphp-83"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-83'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-83">
<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> get_post_image<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iImageNumber</span> = <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$bPrint</span> = <span style="color:#000000; font-weight:bold;">false</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:#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;">&nbsp; &nbsp; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$post</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:#0000FF;">$szPostContent</span> = <span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_content</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:#0000FF;">$szSearchPattern</span> = <span style="color:#FF0000;">'~&lt;img [^<span style="color:#000099; font-weight:bold;">\></span>]*<span style="color:#000099; font-weight:bold;">\ </span>/&gt;~'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/preg_match"><span style="color:#000066;">preg_match</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$szSearchPattern</span>, <span style="color:#0000FF;">$szPostContent</span>, <span style="color:#0000FF;">$pics</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; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$bPrint</span> == <span style="color:#000000; font-weight:bold;">true</span> &amp;&amp; !<a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$pics</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$pics</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$iImageNumber</span><span style="color:#006600; font-weight:bold;">&#93;</span>; <span style="color:#616100;">else</span> <span style="color:#616100;">return</span> <span style="color:#0000FF;">$pics</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$iImageNumber</span><span style="color:#006600; font-weight:bold;">&#93;</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>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Obtener los artículos más recientes</h3>
<p>Fuente: <a href="http://www.mattvarone.com/wordpress/functionsphp-wordpress-themes/" title="Ir al artículo">http://www.mattvarone.com/wordpress/functionsphp-wordpress-themes/</a><br />
Parámetros:<br />
1. Cantidad: (por defecto 5 ) – Número de entradas para mostrar.<br />
2. Categorías: (por defecto todas las categorías ) – Categorías a incluír o excluir.<br />
3. HTML anterior: ( por defecto <em>li</em> ) – HTML antes del enlace al artículo.<br />
4. HTML después: (por defecto <em>/li </em>) – HTML después del enlace.<br />
Ejemplo de uso:</p>
<div class="igBar"><span id="lphp-84"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-84'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-84">
<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:#FF9933; font-style:italic;">// obtiene las 10 últimas entradas de todas las categorías excepto de la categoría 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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'wp_list_recent_posts'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> wp_list_recent_posts<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#CC66CC;color:#800000;">10</span>, <span style="color:#FF0000;">'-5'</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;">&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;">&lt;/pre&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">La función que va en functions.php es:</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;pre lang=<span style="color:#FF0000;">"php"</span> line=<span style="color:#FF0000;">"1"</span>&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;">function</span> wp_list_recent_posts<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iAmount</span> = <span style="color:#CC66CC;color:#800000;">5</span>, <span style="color:#0000FF;">$szCat</span> = <span style="color:#000000; font-weight:bold;">null</span>, <span style="color:#0000FF;">$szBefore</span> = <span style="color:#FF0000;">"&lt;li&gt;"</span>, <span style="color:#0000FF;">$szAfter</span> = <span style="color:#FF0000;">"&lt;/li&gt;"</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:#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:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$szCat</span> != <span style="color:#000000; font-weight:bold;">null</span> <span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#0000FF;">$szCat</span> = <span style="color:#FF0000;">"&amp;cat="</span> . <span style="color:#0000FF;">$szCat</span> : <span style="color:#0000FF;">$szCat</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:#0000FF;">$aRecentPosts</span> = <span style="color:#000000; font-weight:bold;">new</span> WP_Query<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">"showposts="</span> . <span style="color:#0000FF;">$iAmount</span> . <span style="color:#0000FF;">$szCat</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; <span style="color:#616100;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$aRecentPosts</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;">$aRecentPosts</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>;</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:#0000FF;">$szReturn</span> .= <span style="color:#0000FF;">$szBefore</span> . <span style="color:#FF0000;">'&lt;a href=&quot;'</span> . get_permalink<span style="color:#006600; font-weight:bold;">&#40;</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:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'&lt;/a&gt;'</span> . <span style="color:#0000FF;">$szAfter</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;">endwhile</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; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$szReturn</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>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Obtener los artículos más populares basado en el número de comentarios</h3>
<p>Fuente: <a href="http://www.gilbertpellegrom.co.uk/top-wordpress-functions-for-your-functions-php-file/" title="Ir al artículo">http://www.gilbertpellegrom.co.uk/top-wordpress-functions-for-your-functions-php-file/</a><br />
Se puede cambiar el número de artículos cambiando LIMIT al final de $popularposts (en el ejemplo a continuación mostrará los 6 primeros).</p>
<div class="igBar"><span id="lphp-85"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-85'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-85">
<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> get_popular_posts<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;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$wpdb</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:#0000FF;">$now</span> = <a href="http://www.php.net/gmdate"><span style="color:#000066;">gmdate</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Y-m-d H:i:s"</span>,<a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><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>;</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:#0000FF;">$lastmonth</span> = <a href="http://www.php.net/gmdate"><span style="color:#000066;">gmdate</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Y-m-d H:i:s"</span>,<a href="http://www.php.net/gmmktime"><span style="color:#000066;">gmmktime</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"H"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"i"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"s"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"m"</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">12</span>,<a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"d"</span><span style="color:#006600; font-weight:bold;">&#41;</span>,<a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Y"</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;">&#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:#0000FF;">$popularposts</span> = <span style="color:#FF0000;">"SELECT ID, post_title, COUNT($wpdb-&gt;comments.comment_post_ID) AS 'stammy' FROM $wpdb-&gt;posts, $wpdb-&gt;comments WHERE comment_approved = '1' AND $wpdb-&gt;posts.ID=$wpdb-&gt;comments.comment_post_ID AND post_status = 'publish' AND post_date &lt;'$now' AND post_date&gt; '$lastmonth' AND comment_status = 'open' GROUP BY $wpdb-&gt;comments.comment_post_ID ORDER BY stammy DESC LIMIT 6"</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:#0000FF;">$posts</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:#0000FF;">$popularposts</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; <span style="color:#0000FF;">$popular</span> = <span style="color:#FF0000;">''</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;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$posts</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$posts</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$post</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$post_title</span> = <a href="http://www.php.net/stripslashes"><span style="color:#000066;">stripslashes</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">post_title</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; &nbsp; &nbsp; <span style="color:#0000FF;">$guid</span> = get_permalink<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span>-&gt;<span style="color:#006600;">ID</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; &nbsp; &nbsp; <span style="color:#0000FF;">$popular</span> .= <span style="color:#FF0000;">'&lt;li&gt;&lt;a href=&quot;'</span>.<span style="color:#0000FF;">$guid</span>.<span style="color:#FF0000;">'&quot; title=&quot;'</span>.<span style="color:#0000FF;">$post_title</span>.<span style="color:#FF0000;">'&quot;&gt;'</span>.<span style="color:#0000FF;">$post_title</span>.<span style="color:#FF0000;">'&lt;/a&gt;&lt;/li&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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$i</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:#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;">&nbsp; &nbsp; <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;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$popular</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Mostrar el Copyright</h3>
<p>Esta función muestra una información de copyright dinámica, es decir, se irá actualizando cada año.<br />
Fuente: <a href="http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/" title="Ir al artículo">http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/</a><br />
Parámetros:<br />
1. Año: ( por defecto el año actual ) – Si se da un año previo al actual se mostrará así:  2006 – 2008.<br />
2. Separador: ( por defecto: " – " ) – Texto utilizado para separar los años (en el caso de que se haya declarado un año previo al actual).<br />
3. Cola: ( por defecto ". Todos los derechos reservados." ) – Texto a mostrar tras la información del copyright.</p>
<p>Uso de la función:</p>
<div class="igBar"><span id="lphp-86"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-86'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-86">
<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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'display_copyright'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> display_copyright<span style="color:#006600; font-weight:bold;">&#40;</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:#FF9933; font-style:italic;">// Mostrará: &lt;div id=&quot;copyright&quot;&gt;&amp;amp;copy; 2008. Blog Name. Todos los derechos reservados.&lt;/div&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;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'display_copyright'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> display_copyright<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#CC66CC;color:#800000;">2006</span>, <span style="color:#FF0000;">' a '</span>, <span style="color:#FF0000;">'. Some rights reserved.'</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:#FF9933; font-style:italic;">// Mostrará: &lt;div id=&quot;copyright&quot;&gt;&amp;amp;copy; 2006 a 2008. Blog Name. Some rights reserved.&lt;/div&gt; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La función que va en functions.php es:</p>
<div class="igBar"><span id="lphp-87"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-87'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-87">
<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> display_copyright<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iYear</span> = <span style="color:#000000; font-weight:bold;">null</span>, <span style="color:#0000FF;">$szSeparator</span> = <span style="color:#FF0000;">" - "</span>, <span style="color:#0000FF;">$szTail</span> = <span style="color:#FF0000;">'. Todos los derechos reservados.'</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:#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;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;div id=&quot;copyright&quot;&gt;'</span> . display_years<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iYear</span>, <span style="color:#0000FF;">$szSeparator</span>, <span style="color:#000000; font-weight:bold;">false</span> <span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">' &amp;copy; '</span> . get_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> . <span style="color:#0000FF;">$szTail</span> . <span style="color:#FF0000;">'&lt;/div&gt;'</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;">&nbsp;</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;">function</span> display_years<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iYear</span> = <span style="color:#000000; font-weight:bold;">null</span>, <span style="color:#0000FF;">$szSeparator</span> = <span style="color:#FF0000;">" - "</span>, <span style="color:#0000FF;">$bPrint</span> = <span style="color:#000000; font-weight:bold;">true</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:#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:#0000FF;">$iCurrentYear</span> = <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">"Y"</span> <span style="color:#006600; font-weight:bold;">&#41;</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; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/is_int"><span style="color:#000066;">is_int</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iYear</span> <span style="color:#006600; font-weight:bold;">&#41;</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; <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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$iYear</span> = <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$iCurrentYear</span>&gt; <span style="color:#0000FF;">$iYear</span> <span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#0000FF;">$iYear</span> = <span style="color:#0000FF;">$iYear</span> . <span style="color:#0000FF;">$szSeparator</span> . <span style="color:#0000FF;">$iCurrentYear</span> : <span style="color:#0000FF;">$iYear</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:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$iYear</span> = <span style="color:#0000FF;">$iCurrentYear</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:#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;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$bPrint</span> == <span style="color:#000000; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$iYear</span>; <span style="color:#616100;">else</span> <span style="color:#616100;">return</span> <span style="color:#0000FF;">$iYear</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>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Botón para abrir los PDF en Google Docs</h3>
<p>Uso:</p>
<div class="igBar"><span id="lphp-88"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-88'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-88">
<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:#006600; font-weight:bold;">&#91;</span>pdf href=<span style="color:#FF0000;">"http://yoursite.com/linktoyour/file.pdf"</span><span style="color:#006600; font-weight:bold;">&#93;</span>View PDF<span style="color:#006600; font-weight:bold;">&#91;</span>/pdf<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Fuente: &lt;a href=<span style="color:#FF0000;">"http://www.wpfunc.com/wordpress/create-pdf-button.html"</span> title=<span style="color:#FF0000;">"Ir al artículo"</span>&gt;http:<span style="color:#FF9933; font-style:italic;">//www.wpfunc.com/wordpress/create-pdf-button.html&lt;/a&gt; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Función en functions.php:</p>
<div class="igBar"><span id="lphp-89"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-89'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-89">
<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> pdflink<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$attr</span>, <span style="color:#0000FF;">$content</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> <span style="color:#FF0000;">'&lt;a class=&quot;pdf&quot; href=&quot;http://docs.google.com/viewer?url='</span> . <span style="color:#0000FF;">$attr</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'href'</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#FF0000;">'&quot;&gt;'</span>.<span style="color:#0000FF;">$content</span>.<span style="color:#FF0000;">'&lt;/a&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;"><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_shortcode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'pdf'</span>, <span style="color:#FF0000;">'pdflink'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3> Añade un ID al <em>ul</em> que se encuentra dentro de un menu desplegable</h3>
<p>Si hemos creado un menú desplegable del tipo <em>wp_list_pages('exclude=116,122&#038;title_li=');</em> veremos que se crea un menú en el que el <em>ul</em> principal tiene la clase <em>topnav</em>. Si queremos que el <em>ul</em> anidado tenga otra clase (por ejemplo <em>subnav</em>) escribiríamos esta función:</p>
<div class="igBar"><span id="lphp-90"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-90'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-90">
<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> add_menuclass<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ulclass</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;">return</span> <a href="http://www.php.net/preg_replace"><span style="color:#000066;">preg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/&lt;ul&gt;/'</span>, <span style="color:#FF0000;">'&lt;ul class=&quot;subnav&quot;&gt;'</span>, <span style="color:#0000FF;">$ulclass</span>, <span style="color:#CC66CC;color:#800000;">1</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:#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;">'wp_list_pages'</span>,<span style="color:#FF0000;">'add_menuclass'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Cambiar el avatar por defecto</h3>
<p>Primero creamos un nuevo avatar de 100x100 pixels. Luego lo subimos a /wp-content/themes/tu-tema/images/, grabándolo como gravatar.jpg.</p>
<p>Ahora añadimos este código a nuestro functions.php:</p>
<div class="igBar"><span id="lphp-91"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-91'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-91">
<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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !<a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'fb_addgravatar'</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></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:#000000; font-weight:bold;">function</span> fb_addgravatar<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$avatar_defaults</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$myavatar</span> = get_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:#FF0000;">'/images/gravatar.jpg'</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:#FF9933; font-style:italic;">//avatar por defecto</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:#0000FF;">$avatar_defaults</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$myavatar</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'Nuevo gravatar'</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> <span style="color:#0000FF;">$avatar_defaults</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:#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;">&nbsp;add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'avatar_defaults'</span>, <span style="color:#FF0000;">'fb_addgravatar'</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Añade los scripts de Contact Form 7 sólo en las páginas seleccionadas</h3>
<p>Suelo utilizar Contact Form 7, pero lo malo es que sus scripts se añaden en todas las páginas, esté presente el formulario o no. Con esta función se evita ese problema. Por ejemplo, si sólo lo quiero en la página con ID=33:</p>
<div class="igBar"><span id="lphp-92"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/#" onclick="javascript:showCodeTxt('php-92'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-92">
<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> add_wpcf7_scripts<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;">&#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;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> is_page<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'33'</span><span style="color:#006600; font-weight:bold;">&#41;</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; wpcf7_enqueue_scripts<span style="color:#006600; font-weight:bold;">&#40;</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:#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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> ! is_admin<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; WPCF7_LOAD_JS <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; remove_action<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'init'</span>, <span style="color:#FF0000;">'wpcf7_enqueue_scripts'</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;">add_action<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'wp'</span>, <span style="color:#FF0000;">'add_wpcf7_scripts'</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>



¿Te gustó este post? ¡Compártelo!


	<a rel="nofollow"  href="http://bitacoras.com/anotaciones/http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="Bitacoras.com"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/bitacoras.png" title="Bitacoras.com" alt="Bitacoras.com" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="TwitThis"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/twitter.png" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F&amp;t=35%20Funciones%20%C3%BAtiles%20para%20functions.php%20en%20Wordpress" title="Facebook"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://meneame.net/submit.php?url=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="Meneame"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F&amp;title=35%20Funciones%20%C3%BAtiles%20para%20functions.php%20en%20Wordpress&amp;annotation=%0D%0A%0D%0ANormalmente%20cualquier%20tema%20de%20Wordpress%20que%20utilicemos%2C%20ya%20sea%20externo%20o%20creado%20por%20nosotros%2C%20tiene%20un%20archivo%20functions.php%20%20donde%20se%20agrupan%20las%20funciones%20que%20va%20a%20utilizar%20nuestro%20tema.%20Su%20utilidad%20puede%20ser%20de%20lo%20m%C3%A1s%20variada%2C%20desde%20cambiar%20c" title="Google Bookmarks"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F&amp;title=35%20Funciones%20%C3%BAtiles%20para%20functions.php%20en%20Wordpress&amp;notes=%0D%0A%0D%0ANormalmente%20cualquier%20tema%20de%20Wordpress%20que%20utilicemos%2C%20ya%20sea%20externo%20o%20creado%20por%20nosotros%2C%20tiene%20un%20archivo%20functions.php%20%20donde%20se%20agrupan%20las%20funciones%20que%20va%20a%20utilizar%20nuestro%20tema.%20Su%20utilidad%20puede%20ser%20de%20lo%20m%C3%A1s%20variada%2C%20desde%20cambiar%20c" title="del.icio.us"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F&amp;title=35%20Funciones%20%C3%BAtiles%20para%20functions.php%20en%20Wordpress" title="Live"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="Technorati"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://ping.fm/ref/?link=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F&amp;title=35%20Funciones%20%C3%BAtiles%20para%20functions.php%20en%20Wordpress&amp;body=%0D%0A%0D%0ANormalmente%20cualquier%20tema%20de%20Wordpress%20que%20utilicemos%2C%20ya%20sea%20externo%20o%20creado%20por%20nosotros%2C%20tiene%20un%20archivo%20functions.php%20%20donde%20se%20agrupan%20las%20funciones%20que%20va%20a%20utilizar%20nuestro%20tema.%20Su%20utilidad%20puede%20ser%20de%20lo%20m%C3%A1s%20variada%2C%20desde%20cambiar%20c" title="Ping.fm"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="Wikio"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio" alt="Wikio" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/getpf?url=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="Turn this article into a PDF!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/pdf.png" title="Turn this article into a PDF!" alt="Turn this article into a PDF!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=35%20Funciones%20%C3%BAtiles%20para%20functions.php%20en%20Wordpress&amp;body=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="E-mail this story to a friend!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fayudawordpress.com%2F35-funciones-utiles-para-functions-php-en-wordpress%2F" title="Print this article!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a>


<br/><br/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=L0mWqfCpK0g:tvvJLIJgpPk:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=L0mWqfCpK0g:tvvJLIJgpPk:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/L0mWqfCpK0g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/AyudaWordpress/~3/L0mWqfCpK0g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excluir la última entrada del loop</title>
		<link>http://feedproxy.google.com/~r/AyudaWordpress/~3/FNVqr8GVlkI/</link>
		<comments>http://feedproxy.google.com/~r/AyudaWordpress/~3/FNVqr8GVlkI/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 16:36:36 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Codex]]></category>
		<category><![CDATA[código]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[offset]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Tutoriales / Trucos]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=7346</guid>
		<description><![CDATA[
Una de las funciones más utilizadas en los temas estilo revista, sobre todo de aquellos que disponen de un bloque de entradas destacadas, es la de excluir la última entrada (o varias de las últimas) del loop de la portada de tu sitio.
Y es algo bastante sencillo usando el parámetro 'offset' de la función 'query_posts'. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayudawordpress.com/wp-content/uploads/2010/03/patos-en-fila-500x267.jpg" alt="" title="patos en fila" width="500" height="267" class="aligncenter size-medium wp-image-7347" /></p>
<p>Una de las funciones más utilizadas en los temas estilo revista, sobre todo de aquellos que disponen de un bloque de entradas destacadas, es la de <a href="http://www.wpbeginner.com/wp-themes/how-to-exclude-latest-post-from-the-wordpress-post-loop/">excluir la última entrada</a> (o varias de las últimas) del <code>loop</code> de la portada de tu sitio.</p>
<p>Y es algo bastante sencillo usando el <a href="http://codex.wordpress.org/Template_Tags/query_posts#Offset_Parameter">parámetro <code>'offset'</code> de la función <code>'query_posts'</code></a>. Lo único que tienes que hacer es añadir la siguiente línea al loop de la portada que muestra los últimos posts:</p>
<div class="igBar"><span id="lphp-13"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/FNVqr8GVlkI/#" onclick="javascript:showCodeTxt('php-13'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-13">
<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;">query_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'posts_per_page=5&amp;offset=1'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En este ejemplo lo que hacemos es indicar que muestre los 5 últimos posts pero excluyendo el más reciente, definido en "<code>offset=1</code>".</p>
<p>Un ejemplo del código aplicado al loop sería así:</p>
<div class="igBar"><span id="lphp-14"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/FNVqr8GVlkI/#" onclick="javascript:showCodeTxt('php-14'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-14">
<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;">query_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'posts_per_page=5&amp;offset=1'</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> have_posts<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:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span> have_posts<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> : the_post<span style="color:#006600; font-weight:bold;">&#40;</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>
</ol>
</div>
</div>
</div>
<p></p>



¿Te gustó este post? ¡Compártelo!


	<a rel="nofollow"  href="http://bitacoras.com/anotaciones/http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="Bitacoras.com"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/bitacoras.png" title="Bitacoras.com" alt="Bitacoras.com" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="TwitThis"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/twitter.png" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F&amp;t=Excluir%20la%20%C3%BAltima%20entrada%20del%20loop" title="Facebook"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://meneame.net/submit.php?url=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="Meneame"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F&amp;title=Excluir%20la%20%C3%BAltima%20entrada%20del%20loop&amp;annotation=%0D%0A%0D%0AUna%20de%20las%20funciones%20m%C3%A1s%20utilizadas%20en%20los%20temas%20estilo%20revista%2C%20sobre%20todo%20de%20aquellos%20que%20disponen%20de%20un%20bloque%20de%20entradas%20destacadas%2C%20es%20la%20de%20excluir%20la%20%C3%BAltima%20entrada%20%28o%20varias%20de%20las%20%C3%BAltimas%29%20del%20loop%20de%20la%20portada%20de%20tu%20sitio.%0D%0A%0D%0AY%20es%20" title="Google Bookmarks"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F&amp;title=Excluir%20la%20%C3%BAltima%20entrada%20del%20loop&amp;notes=%0D%0A%0D%0AUna%20de%20las%20funciones%20m%C3%A1s%20utilizadas%20en%20los%20temas%20estilo%20revista%2C%20sobre%20todo%20de%20aquellos%20que%20disponen%20de%20un%20bloque%20de%20entradas%20destacadas%2C%20es%20la%20de%20excluir%20la%20%C3%BAltima%20entrada%20%28o%20varias%20de%20las%20%C3%BAltimas%29%20del%20loop%20de%20la%20portada%20de%20tu%20sitio.%0D%0A%0D%0AY%20es%20" title="del.icio.us"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F&amp;title=Excluir%20la%20%C3%BAltima%20entrada%20del%20loop" title="Live"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="Technorati"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://ping.fm/ref/?link=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F&amp;title=Excluir%20la%20%C3%BAltima%20entrada%20del%20loop&amp;body=%0D%0A%0D%0AUna%20de%20las%20funciones%20m%C3%A1s%20utilizadas%20en%20los%20temas%20estilo%20revista%2C%20sobre%20todo%20de%20aquellos%20que%20disponen%20de%20un%20bloque%20de%20entradas%20destacadas%2C%20es%20la%20de%20excluir%20la%20%C3%BAltima%20entrada%20%28o%20varias%20de%20las%20%C3%BAltimas%29%20del%20loop%20de%20la%20portada%20de%20tu%20sitio.%0D%0A%0D%0AY%20es%20" title="Ping.fm"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="Wikio"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio" alt="Wikio" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/getpf?url=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="Turn this article into a PDF!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/pdf.png" title="Turn this article into a PDF!" alt="Turn this article into a PDF!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Excluir%20la%20%C3%BAltima%20entrada%20del%20loop&amp;body=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="E-mail this story to a friend!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fayudawordpress.com%2Fexcluir-la-ultima-entrada-del-loop%2F" title="Print this article!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a>


<br/><br/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=FNVqr8GVlkI:hOvE4PYfbdA:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=FNVqr8GVlkI:hOvE4PYfbdA:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/FNVqr8GVlkI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/AyudaWordpress/~3/FNVqr8GVlkI/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Usando shortcodes en todas partes</title>
		<link>http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/</link>
		<comments>http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 17:51:42 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[código]]></category>
		<category><![CDATA[Experto]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Shortcodes]]></category>
		<category><![CDATA[taxonomía]]></category>
		<category><![CDATA[Tutoriales / Trucos]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=7336</guid>
		<description><![CDATA[
Ya hemos visto muchas maneras de personalizar WordPress con shortcodes pero estas pequeñas maravillas pueden usarse en muchos más sitios que en el editor de entradas, aquí tienes unos cuantos buenos ejemplos … 

Shorcodes en widgets de texto
Lo primero es añadir este código al fichero functions.php de tu tema activo:
Clic para ver Texto Plano
PHP:




add_filter&#40; 'widget_text', 'shortcode_unautop'&#41;;


add_filter&#40; [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img src="http://ayudawordpress.com/wp-content/uploads/2010/03/wordpress-hack.jpg" title="hack wordpress" alt="hack wordpress" /></p>
<p>Ya hemos visto muchas maneras de personalizar WordPress con <code>shortcodes</code> pero estas pequeñas maravillas <a href="http://sillybean.net/wordpress/content/using-shortcodes-everywhere/">pueden usarse en muchos más sitios</a> que en el editor de entradas, aquí tienes unos cuantos buenos ejemplos … <br />
<span id="more-7336"></span></p>
<h3>Shorcodes en widgets de texto</h3>
<p>Lo primero es añadir este código al fichero <code>functions.php</code> de tu tema activo:</p>
<div class="igBar"><span id="lphp-22"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#" onclick="javascript:showCodeTxt('php-22'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'widget_text'</span>, <span style="color:#FF0000;">'shortcode_unautop'</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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'widget_text'</span>, <span style="color:#FF0000;">'do_shortcode'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La segunda línea es la que hace que funcionen los shortcodes en el widget de texto. Además, hay que tener en cuenta que los widgets de texto tienen una casilla para "añadir saltos de párrafo automáticamente", pues bien, la segunda linea inhabilita el código <code>autop</code> que podría, en caso de estar marcada la casilla, meter el shortcode introducido en un párrafo o incluso romper las tags.</p>
<h3>Shortcodes en el tema</h3>
<p>También se pueden usar shortcodes en el tema que uses. Para ello utilizamos la función <code>do_shortcode()</code> en la que el argumento será una cadena que contendrá el shortcode.</p>
<p>Por ejemplo, para mostrar el shortcode <code>[publicidad]</code> en tu tema pondrías algo así donde quieras que aparezca el resultado esperado:</p>
<div class="igBar"><span id="lphp-23"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#" onclick="javascript:showCodeTxt('php-23'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-23">
<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> do_shortcode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'[publicidad]'</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 <code>do_shortcode()</code> acepta cualquier tipo de texto. Si la cadena contiene un shortcode procesará ese código. De este modo, por ejemplo, podrías mostrar manualmente contenido de tus entradas de este modo:</p>
<div class="igBar"><span id="lphp-24"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#" onclick="javascript:showCodeTxt('php-24'); return false;">Clic para ver Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<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;">$content</span> = get_the_content<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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> do_shortcode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$content</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>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Shortcodes en comentarios</h3>
<p>De nuevo recurrimos al fichero <code>functions.php</code> para añadirle este código que permite shortcodes en los campos de comentarios:</p>
<div class="igBar"><span id="lphp-25"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#" onclick="javascript:showCodeTxt('php-25'); return false;">Clic para 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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'comment_text'</span>, <span style="color:#FF0000;">'shortcode_unautop'</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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'comment_text'</span>, <span style="color:#FF0000;">'do_shortcode'</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Shortcodes en extractos</h3>
<p>Ahora, en <code>functions.php</code> añadiremos esto para poder insertar shortcodes en los extractos de entrada:</p>
<div class="igBar"><span id="lphp-26"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#" onclick="javascript:showCodeTxt('php-26'); return false;">Clic para 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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'the_excerpt'</span>, <span style="color:#FF0000;">'shortcode_unautop'</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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'the_excerpt'</span>, <span style="color:#FF0000;">'do_shortcode'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Shortcodes en la descripción de usuario</h3>
<p>Para poder meter shortcodes en la descripción del usuario hay que pasar la cadena de descripción por la función <code>do_shortcode()</code>. Para ello tendrás que añadir esto a tu tema activo:</p>
<div class="igBar"><span id="lphp-27"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#" onclick="javascript:showCodeTxt('php-27'); return false;">Clic para 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></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// $user_id = 3;</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;">$userdata</span> = get_userdata<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$user_id</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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> do_shortcode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$userdata</span>-&gt;<span style="color:#006600;">description</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:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Solo tendrás que cambiar el ID de usuario, en este caso el 3.</p>
<h3>Shortcodes en descripciones de etiquetas, categorías y taxonomías</h3>
<p>También puedes filtrar estas descripciones. Para ello recurrimos de nuevo al fichero <code>functions.php</code>:</p>
<div class="igBar"><span id="lphp-28"><a href="http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/#" onclick="javascript:showCodeTxt('php-28'); return false;">Clic para 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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'term_description'</span>, <span style="color:#FF0000;">'shortcode_unautop'</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;">add_filter<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'term_description'</span>, <span style="color:#FF0000;">'do_shortcode'</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Un mundo de posibilidades más ¿no?</p>



¿Te gustó este post? ¡Compártelo!


	<a rel="nofollow"  href="http://bitacoras.com/anotaciones/http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="Bitacoras.com"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/bitacoras.png" title="Bitacoras.com" alt="Bitacoras.com" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="TwitThis"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/twitter.png" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F&amp;t=Usando%20shortcodes%20en%20todas%20partes" title="Facebook"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://meneame.net/submit.php?url=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="Meneame"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F&amp;title=Usando%20shortcodes%20en%20todas%20partes&amp;annotation=%0D%0A%0D%0AYa%20hemos%20visto%20muchas%20maneras%20de%20personalizar%20WordPress%20con%20shortcodes%20pero%20estas%20peque%C3%B1as%20maravillas%20pueden%20usarse%20en%20muchos%20m%C3%A1s%20sitios%20que%20en%20el%20editor%20de%20entradas%2C%20aqu%C3%AD%20tienes%20unos%20cuantos%20buenos%20ejemplos%20%E2%80%A6%C2%A0%0D%0A%0D%0A%0D%0A%0D%0AShorcodes%20en%20widgets%20d" title="Google Bookmarks"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F&amp;title=Usando%20shortcodes%20en%20todas%20partes&amp;notes=%0D%0A%0D%0AYa%20hemos%20visto%20muchas%20maneras%20de%20personalizar%20WordPress%20con%20shortcodes%20pero%20estas%20peque%C3%B1as%20maravillas%20pueden%20usarse%20en%20muchos%20m%C3%A1s%20sitios%20que%20en%20el%20editor%20de%20entradas%2C%20aqu%C3%AD%20tienes%20unos%20cuantos%20buenos%20ejemplos%20%E2%80%A6%C2%A0%0D%0A%0D%0A%0D%0A%0D%0AShorcodes%20en%20widgets%20d" title="del.icio.us"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F&amp;title=Usando%20shortcodes%20en%20todas%20partes" title="Live"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="Technorati"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://ping.fm/ref/?link=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F&amp;title=Usando%20shortcodes%20en%20todas%20partes&amp;body=%0D%0A%0D%0AYa%20hemos%20visto%20muchas%20maneras%20de%20personalizar%20WordPress%20con%20shortcodes%20pero%20estas%20peque%C3%B1as%20maravillas%20pueden%20usarse%20en%20muchos%20m%C3%A1s%20sitios%20que%20en%20el%20editor%20de%20entradas%2C%20aqu%C3%AD%20tienes%20unos%20cuantos%20buenos%20ejemplos%20%E2%80%A6%C2%A0%0D%0A%0D%0A%0D%0A%0D%0AShorcodes%20en%20widgets%20d" title="Ping.fm"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="Wikio"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio" alt="Wikio" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/getpf?url=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="Turn this article into a PDF!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/pdf.png" title="Turn this article into a PDF!" alt="Turn this article into a PDF!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Usando%20shortcodes%20en%20todas%20partes&amp;body=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="E-mail this story to a friend!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fayudawordpress.com%2Fusando-shortcodes-en-todas-partes%2F" title="Print this article!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a>


<br/><br/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=JYhOEsCAG3s:-HmBF-ZJv7I:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=JYhOEsCAG3s:-HmBF-ZJv7I:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/JYhOEsCAG3s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/AyudaWordpress/~3/JYhOEsCAG3s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Smart Image II: mejorando la gestión de imágenes</title>
		<link>http://feedproxy.google.com/~r/AyudaWordpress/~3/Q33ze8W8SRQ/</link>
		<comments>http://feedproxy.google.com/~r/AyudaWordpress/~3/Q33ze8W8SRQ/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 23:02:14 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Experto]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[imágenes]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Thumbnail]]></category>
		<category><![CDATA[Wordpress.org]]></category>

		<guid isPermaLink="false">http://ayudawordpress.com/?p=6965</guid>
		<description><![CDATA[
Si no conoces WP Smart Image II estoy seguro de que te estás perdiendo, no solo un gran plugin creado por Darío Ferrer, sino muchas de las posibilidades que WordPress ofrece para la gestión adecuada de imágenes, pues se integra y mejora enormemente la funcionalidad de inserción de imágenes en tu sitio, aprovechando las funciones [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-6966" title="logo-wpsi-II" src="http://ayudawordpress.com/wp-content/uploads/2010/01/logo-wpsi-II.gif" alt="" width="489" height="124" /></p>
<p>Si no conoces <a href="http://wordpress.org/extend/plugins/wp-smart-image-ii/">WP Smart Image II</a> estoy seguro de que te estás perdiendo, no solo un gran plugin creado por <strong>Darío Ferrer</strong>, sino muchas de las posibilidades que WordPress ofrece para la gestión adecuada de imágenes, pues se integra y <strong>mejora enormemente la funcionalidad de inserción de imágenes en tu sitio</strong>, aprovechando las funciones internas y vitaminando sus posibilidades.</p>
<p>Ya la primera versión del plugin era una maravilla, pero cuando Darío revisó su trabajo previo <a href="http://www.darioferrer.com/wordpress/anunciando-wp-smart-image-ii-460.html">decidió remozar completamente el plugin y crear WP Smart Image II</a>, convirtiéndolo en su razón de ser: <strong>un recurso imprescindible para el diseñador web</strong>, pero no solo para el diseñador sino para cualquiera que habitualmente utilice imágenes en su sitio creado con WordPress.</p>
<p>Es importante que sepas que <strong>WP Smart Imagen II</strong> viene a ser una sustitución de la función '<code>post_thumbnail</code>', pero no solo la sustituye sino que la mejora. En <a href="http://www.darioferrer.com/wpsi/the-post-thumbnail-vs-wp-smart-image-ii">esta entrada</a> tienes la lista completa de funcionalidades frente a la función nativa de WordPress.</p>
<p><a rel="attachment wp-att-6967" href="http://ayudawordpress.com/wp-content/uploads/2010/01/wpsmi-sample.jpg" ><img class="aligncenter size-medium wp-image-6967" title="wpsmi sample" src="http://ayudawordpress.com/wp-content/uploads/2010/01/wpsmi-sample-432x500.jpg" alt="" width="432" height="500" /></a></p>
<p>Tan comprometido está Darío con el proyecto que hasta <a href="http://www.lab.darioferrer.com/doc/index.php?title=Pgina_Principal">ha creado un Wiki</a> en el que documentar - incluso más allá de lo razonable - el uso y motivos de WP Smart Image II, otro motivo por el que merece la pena apoyar este proyecto, de un desarrollador hispano, de un amigo, de un compañero de comunidad que ayuda a que WordPress sea cada día mejor ¿no os parece?.</p>
<p>Y puede que te preguntes <strong>¿como ayudar a este proyecto?</strong>, pues el mejor modo es usar el plugin en tus sitios, probarlo, informar a Darío de cualquier fallo que encuentres o mejora que se te ocurra, también puedes ayudar en el desarrollo, descargando las últimas versiones en <a href="http://www.lab.darioferrer.com/trac/">su propio Trac</a>.</p>
<p>Si aún no estás convencido de lo que aporta <strong>WP Smart Imagen II</strong>, aquí tienes sus virtudes …</p>
<h3>Diseño y maquetación</h3>
<div>
<ul>
<li>Agregar atributos "width" y "height" mediante métodos CSS o HTML.</li>
<li>Personalizar los atributos "alt" y "title" de las imágenes en caso de que éstas no los tengan.</li>
<li>Elegir entre todos los tipos de tamaños predeterminados disponibles de Wordpress: Miniatura, Medio, Grande y Full. Adicionalmente puedes crear nuevos tamaños predeterminados con el plugin Max Image Size Control y manipularlos Fácilmente con WP Smart Image II.</li>
<li>Configurar y mostrar imágenes predeterminadas si la entrada no tiene una. También puedes optar por no usar imágenes predeterminadas.</li>
<li>Enlazar la imagen al artículo o versión full de la imagen (desde cualquier tamaño), o bien dejarla sin enlace.</li>
<li>Agregar un enlace hacia la versión Full de la imagen desde el tamaño Miniatura o cualquier tamaño.</li>
<li>Mostrar imágenes aleatorias por cada entrada (en lugar de sólo una).</li>
<li>Adaptar el tipo de etiqueta al DTD de tu sitio para una correcta validación W3C.</li>
</ul>
</div>
<h3>Desarrollo web</h3>
<ul>
<li>Elegir el tipo de salida de la función: echo o return.</li>
<li>Añadir clases e ID personalizados a las imágenes, a fin de procesarlas apropiadamente mediante CSS, javascript, PHP y otros recursos..</li>
<li>Obtener la URL de la imagen en lugar de la etiqueta completa.</li>
<li>Añadir y definir atributos a los enlaces, tales como "rel", "class", "id" y "target".</li>
<li>Separar los datos de las imágenes en piezas y mostrarlos individualmente (Alto, ancho, tipo de archivo, ID, etc).</li>
<li>Puedes poner a funcionar el plugin en el Modo PHP, ahorrándote así unos cuantos queries para tareas comunes del sistema.</li>
</ul>
<h3>Blogging</h3>
<ul>
<li>Elegir la imagen a mostrar a través de una amigable caja en tu editor de texto.</li>
<li>Mostrar miniaturas en feeds RSS.</li>
<li>Personalizar tamaños en feeds RSS.</li>
<li>Asignar títulos a las imágenes directamente de la caja de tu editor.</li>
<li>Elegir cualquier imagen de tu librería multimedia y asignarla al artículo, aún si dicha imagen no está vinculada a éste.</li>
</ul>
<p>¿Aún te quedan dudas para darle una oportunidad al que puede ser el futuro en la gestión de imágenes en WordPress?. Luego no digas que no te he avisado.<br />
<h3><font color="#000080">Contenido exclusivo para suscriptores al Feed</font></h3>
<p><font color="#808080">¡Gracias por seguirnos a diario!. Premiamos tu fidelidad ofreciéndote habitualmente contenidos exclusivos. Hoy puedes descargar:</font></p>
<p><a href="http://ayudawordpress.com/?dl_id=60" title="Clic aquí para iniciar la descarga"><img src="http://ayudawordpress.com/wp-content/uploads/2008/01/wp-install.jpg" alt="Clic aquí para iniciar la descarga" align="middle" border="0" height="59" width="43" /> Guía Domina tu Blog</a></p>



¿Te gustó este post? ¡Compártelo!


	<a rel="nofollow"  href="http://bitacoras.com/anotaciones/http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="Bitacoras.com"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/bitacoras.png" title="Bitacoras.com" alt="Bitacoras.com" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="TwitThis"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/twitter.png" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F&amp;t=WP%20Smart%20Image%20II%3A%20mejorando%20la%20gesti%C3%B3n%20de%20im%C3%A1genes" title="Facebook"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://meneame.net/submit.php?url=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="Meneame"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F&amp;title=WP%20Smart%20Image%20II%3A%20mejorando%20la%20gesti%C3%B3n%20de%20im%C3%A1genes&amp;annotation=%0D%0A%0D%0ASi%20no%20conoces%20WP%20Smart%20Image%20II%20estoy%20seguro%20de%20que%20te%20est%C3%A1s%20perdiendo%2C%20no%20solo%20un%20gran%20plugin%20creado%20por%20Dar%C3%ADo%20Ferrer%2C%20sino%20muchas%20de%20las%20posibilidades%20que%20WordPress%20ofrece%20para%20la%20gesti%C3%B3n%20adecuada%20de%20im%C3%A1genes%2C%20pues%20se%20integra%20y%20mejora%20enorm" title="Google Bookmarks"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F&amp;title=WP%20Smart%20Image%20II%3A%20mejorando%20la%20gesti%C3%B3n%20de%20im%C3%A1genes&amp;notes=%0D%0A%0D%0ASi%20no%20conoces%20WP%20Smart%20Image%20II%20estoy%20seguro%20de%20que%20te%20est%C3%A1s%20perdiendo%2C%20no%20solo%20un%20gran%20plugin%20creado%20por%20Dar%C3%ADo%20Ferrer%2C%20sino%20muchas%20de%20las%20posibilidades%20que%20WordPress%20ofrece%20para%20la%20gesti%C3%B3n%20adecuada%20de%20im%C3%A1genes%2C%20pues%20se%20integra%20y%20mejora%20enorm" title="del.icio.us"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F&amp;title=WP%20Smart%20Image%20II%3A%20mejorando%20la%20gesti%C3%B3n%20de%20im%C3%A1genes" title="Live"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="Technorati"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://ping.fm/ref/?link=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F&amp;title=WP%20Smart%20Image%20II%3A%20mejorando%20la%20gesti%C3%B3n%20de%20im%C3%A1genes&amp;body=%0D%0A%0D%0ASi%20no%20conoces%20WP%20Smart%20Image%20II%20estoy%20seguro%20de%20que%20te%20est%C3%A1s%20perdiendo%2C%20no%20solo%20un%20gran%20plugin%20creado%20por%20Dar%C3%ADo%20Ferrer%2C%20sino%20muchas%20de%20las%20posibilidades%20que%20WordPress%20ofrece%20para%20la%20gesti%C3%B3n%20adecuada%20de%20im%C3%A1genes%2C%20pues%20se%20integra%20y%20mejora%20enorm" title="Ping.fm"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.com/vote?url=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="Wikio"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio" alt="Wikio" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/getpf?url=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="Turn this article into a PDF!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/pdf.png" title="Turn this article into a PDF!" alt="Turn this article into a PDF!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=WP%20Smart%20Image%20II%3A%20mejorando%20la%20gesti%C3%B3n%20de%20im%C3%A1genes&amp;body=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="E-mail this story to a friend!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fayudawordpress.com%2Fwp-smart-image-ii%2F" title="Print this article!"><img src="http://ayudawordpress.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a>


<br/><br/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AyudaWordpress?a=Q33ze8W8SRQ:bxS0-7NS3Kk:Dsqc8YHEA1Y"><img src="http://feeds.feedburner.com/~ff/AyudaWordpress?i=Q33ze8W8SRQ:bxS0-7NS3Kk:Dsqc8YHEA1Y" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AyudaWordpress/~4/Q33ze8W8SRQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://feedproxy.google.com/~r/AyudaWordpress/~3/Q33ze8W8SRQ/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cosas que necesitas saber de WordPress 2.9</title>
		<link>http://carrero.es/cosas-que-necesitas-saber-de-wordpress-2-9/4492</link>
		<comments>http://carrero.es/cosas-que-necesitas-saber-de-wordpress-2-9/4492#comments</comments>
		<pubDate>Tue, 17 Nov 2009 21:52:14 +0000</pubDate>
		<dc:creator>planetawordpress</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[Funciones]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Novedades]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[seguridad]]></category>

		<guid isPermaLink="false">http://carrero.es/?p=4492</guid>
		<description><![CDATA[Interesante artículo sobre al menos 10 cosas que necesitas saber sobre el nuevo WordPress 2.9.
Entre las mejoras de esta nueva versión del popular gestor de contenidos que pronto estará disponible de forma oficial podemos comentar algunas funciones nuevas para plantillas como the_post_image() y el soporte de registro, otras novedades para usuario como la disponibilidad de [...]<p>Original Post / Entrada Original: <a href="http://carrero.es">Carrero.es</a>. Si quieres <a href="http://juegosweb.com">Juegos Gratis</a> disfruta aqu&#237; o <a href="http://decoracion2.com">decora tu casa</a>.<br /><br /><a href="http://carrero.es/cosas-que-necesitas-saber-de-wordpress-2-9/4492">Cosas que necesitas saber de WordPress 2.9</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Interesante artículo sobre al menos <strong>10 cosas que necesitas saber sobre el nuevo WordPress 2.9</strong>.</p>
<p>Entre las mejoras de esta nueva versión del popular gestor de contenidos que pronto estará disponible de forma oficial podemos comentar algunas funciones nuevas para plantillas como the_post_image() y el soporte de registro, otras novedades para usuario como la disponibilidad de papelera, edición de imágenes y el plugin oEmbed, mejoras en los comentarios y un API metadatos para plugins. Además de una utilidad incluida para la reparación de la base de datos y la vuelta al soporte de PHP4.</p>
<p>Más información en <a href="http://technosailor.com/2009/11/11/10-things-you-need-to-know-about-wordpress-2-9/">TechnoSailor</a></p>
<p>Original Post / Entrada Original: <a href="http://carrero.es">Carrero.es</a>. Si quieres <a href="http://juegosweb.com">Juegos Gratis</a> disfruta aqu&iacute; o <a href="http://decoracion2.com">decora tu casa</a>.<br/><br/><a href="http://carrero.es/cosas-que-necesitas-saber-de-wordpress-2-9/4492">Cosas que necesitas saber de WordPress 2.9</a></p>
]]></content:encoded>
			<wfw:commentRss>http://carrero.es/cosas-que-necesitas-saber-de-wordpress-2-9/4492/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
