<?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>Johan de Bruin &#187; Custom Values</title>
	<atom:link href="http://www.johandebruin.com/t/custom-values/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johandebruin.com</link>
	<description>Programación en php, tutorial de api wordpress y posicionamiento en buscadores seo.</description>
	<lastBuildDate>Sun, 05 Feb 2012 15:18:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Crear Plantillas de themes para post en WordPress</title>
		<link>http://www.johandebruin.com/crear-plantillas-de-themes-para-post-en-wordpress/</link>
		<comments>http://www.johandebruin.com/crear-plantillas-de-themes-para-post-en-wordpress/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 20:42:28 +0000</pubDate>
		<dc:creator>Johan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Custom Values]]></category>
		<category><![CDATA[Plantilla]]></category>
		<category><![CDATA[Post meta]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Wordpress API]]></category>

		<guid isPermaLink="false">http://www.johandebruin.com/?p=599</guid>
		<description><![CDATA[Podemos crear una plantilla para publicar post especificos en wordpress de la misfa forma que ocurre con las páginas gracias a la combinación del uso de la API de wordpress y del plugin Custom Post Template. Lo que queremos conseguir es mostrar posts de distintas maneras en función a que plantilla seleccionamos en el menu [...]]]></description>
			<content:encoded><![CDATA[<p>Podemos crear una plantilla para publicar post especificos en wordpress de la misfa forma que ocurre con las páginas gracias a la combinación del uso de la API de wordpress y del plugin <a title="Plantilla Post WordPress" href="http://wordpress.org/extend/plugins/custom-post-template/">Custom Post Template</a>. Lo que queremos conseguir es mostrar posts de distintas maneras en función a que plantilla seleccionamos en el menu de post:</p>
<p><a href="http://www.johandebruin.com/wp-content/uploads/2010/06/post-template.jpg"><img src="http://www.johandebruin.com/wp-content/uploads/2010/06/post-template.jpg" alt="" title="post template" width="296" height="365" class="aligncenter size-full wp-image-600" /></a></p>
<p>Gracias a eso, y a un formato de recognición de templates de post, con que añadamos el siguiente comentario en el .php del theme de wordpress podremos definir un formato especifico para ese tipo de post (como añadir metas especificos, imagenes, colores, opciones etc&#8230; especifico), explotando más las posibilidades de wordpress.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name Posts: nombrePlantilla
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><span id="more-599"></span><br />
Aqui un ejemplo de como podriamos adaptar esta plantilla usando comandos de la API de wordpress (lo tipico, llamada al header, titulos, contenido, campos personalizados.. ).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name Posts: nombrePlantilla
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
   &lt;h1&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;
   <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;p class=&quot;serif&quot;&gt;Leer el resto del post;&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   $postMeta = get_post_custom_values('metaKey');
   foreach ( $postMeta as $key =&gt; $value ) {
      echo &quot;$key  =&gt; $value ('metaKey')&lt;br /&gt;&quot;; 
   }
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.johandebruin.com/crear-plantillas-de-themes-para-post-en-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

