<?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>Tableless &#187; php</title>
	<atom:link href="http://tableless.com.br/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://tableless.com.br</link>
	<description>Boas práticas de Desenvolvimento com Padrões Web</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:23:50 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bloginfo Template Tag</title>
		<link>http://tableless.com.br/bloginfo-template-tag/</link>
		<comments>http://tableless.com.br/bloginfo-template-tag/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 01:08:11 +0000</pubDate>
		<dc:creator>Diego Eis</dc:creator>
				<category><![CDATA[Na Prática]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[desenvolvimento web]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://tableless.com.br/?p=1006</guid>
		<description><![CDATA[A Template Tag Bloginfo mostra informações sobre o blog. A maioria dessas informações são modificadas diretamente no painel de controle da sua instalação do WordPress. Isso pode ser utilizado em qualquer lugar do seu site. A Template Tag é a &#8230;]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://tableless.com.br/bloginfo-template-tag/">Template Tag Bloginfo</a> mostra informações sobre o blog. A maioria dessas informações são modificadas diretamente no painel de controle da sua instalação do WordPress. Isso pode ser utilizado em qualquer lugar do seu site. A Template Tag é a <strong>get_bloginfo()</strong>.</p>
<p>Por exempo, se você precisa do nome do site para colocar em algum lugar do site, como o Logo, a sintaxe seria:</p>
<pre lang="php" line="1">
<h1><?php bloginfo('name'); ?></h1>
</pre>
<p><span id="more-1006"></span><br />
Os valores possíveis:</p>
<ul>
<li><strong>&#8216;name&#8217;</strong> &#8211; Nome do site. Valor padrão.</li>
<li><strong>&#8216;description&#8217;</strong> &#8211; Descrição do site.</li>
<li><strong>&#8216;url&#8217;</strong> &#8211; O endereço do site.</li>
<li><strong>&#8216;rdf_url&#8217;</strong> &#8211; Endereço do RDF/RSS 1.0.</li>
<li><strong>&#8216;rss_url&#8217;</strong> &#8211; Endereço do RSS 0.92.</li>
<li><strong>&#8216;rss2_url&#8217;</strong> &#8211; Endereço para RSS 2.0.</li>
<li><strong>&#8216;atom_url&#8217;</strong> &#8211; URL Feed Atom.</li>
<li><strong>&#8216;comments_rss2_url&#8217;</strong> &#8211; Url para acesso do RSS 2.0 dos comentários.</li>
<li><strong>&#8216;pingback_url&#8217;</strong> &#8211; Url dos Pingbacks Pingback (XML-RPC file).</li>
<li><strong>&#8216;admin_email&#8217;</strong> &#8211; Endereço de email do administrador do WordPress.</li>
<li><strong>&#8216;charset&#8217;</strong> &#8211; Tabela de caractéres utilizada no Worpdress; Você define isso na Opções de Leitura no Admin.</li>
<li><strong>&#8216;version&#8217;</strong> &#8211; Mostra a versão do WordPress que você utiliza..</li>
<li><strong>&#8216;text_direction&#8217;</strong> &#8211; Retorna &#8216;rtl&#8217; leitura da direita para esquerda ou &#8216;ltr&#8217; para leitura da esquerda para direita, que é o padrão.</li>
</ul>
<p>Se você quer ler mais sobre WordPress, experimente visitar a <a href="http://tableless.com.br/wordpress/">parte exclusiva sobre WordPress no Tableless</a>.</p>
<p><a href="http://codex.wordpress.org/Template_Tags/bloginfo">Mais sobre Bloginfo no site do WordPress</a>.</p>
<h3  class="related_post_title">Posts Relacionados</h3><ul class="related_post"><li><a href="http://tableless.com.br/wordpress-uma-pequena-introducao/" title="Wordpress &#8211; Uma pequena introdução">Wordpress &#8211; Uma pequena introdução</a></li><li><a href="http://tableless.com.br/wordpress-include-tags/" title="Wordpress Include Tags">Wordpress Include Tags</a></li><li><a href="http://tableless.com.br/html5-diff/" title="HTML5 Diff">HTML5 Diff</a></li><li><a href="http://tableless.com.br/ah-o-maravilhoso-mundo-real/" title="Ah, o maravilhoso mundo real">Ah, o maravilhoso mundo real</a></li><li><a href="http://tableless.com.br/implementar-xhtmlcss-e-gratis/" title="Implementar XHTML/CSS é grátis">Implementar XHTML/CSS é grátis</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tableless.com.br/bloginfo-template-tag/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress Include Tags</title>
		<link>http://tableless.com.br/wordpress-include-tags/</link>
		<comments>http://tableless.com.br/wordpress-include-tags/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 06:22:43 +0000</pubDate>
		<dc:creator>Diego Eis</dc:creator>
				<category><![CDATA[Na Prática]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[desenvolvimento]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://tableless.com.br/?p=998</guid>
		<description><![CDATA[O WordPress tem 3 TemplatesTags para incluir elementos básicos de Cabeçalho, Coluna lateral (sidebar) e Rodapé, são eles: get_header(), get_sidebar() e get_footer(). Essas TemplateTags não aceitam qualquer tipo de parâmetro, portanto são simples de se aplicar. Em todos os themes &#8230;]]></description>
			<content:encoded><![CDATA[<p>O <a href="http://wordpress.org/">WordPress</a> tem 3 TemplatesTags para incluir elementos básicos de Cabeçalho, Coluna lateral (sidebar) e Rodapé, são eles: get_header(), get_sidebar() e get_footer(). Essas TemplateTags não aceitam qualquer tipo de parâmetro, portanto são simples de se aplicar. Em todos os themes do WordPress, essas 3 TemplateTags estão sempre presentes, mesmo assim, você pode modificar isso incluindo outro arquivo que não seja o padrão que o WP estabeleceu.<br />
<span id="more-998"></span></p>
<h3>get_header()</h3>
<p>O <strong>&lt;?php get_header(); ?&gt;</strong>inclui em seu template o arquivo header.php, que é onde vai o cabeçalho do seu site. É lá onde vai o começo da estrutura básica do HTML &#8211; Doctype, html, head, title, metatags e body.</p>
<h3>get_sidebar()</h3>
<p>O <strong>&lt;?php get_sidebar(); ?&gt;</strong> é a função que incluirá em seu template a sua coluna lateral. Menu lateral, banners, informações e tudo o que normalmente vai em um sidebar.</p>
<h3>get_footer()</h3>
<p>O <strong>&lt;?php get_footer(); ?&gt;</strong> inclui em seu template o arquivo footer.php. É lá onde você normalmente termina seu . É neste arquivo que você terá o código do rodapé e de elementos que sempre seguirão o final da página.</p>
<p>Se o WordPress não encontrar, por exemplo o arquivo footer.php, ele irá incluir o arquivo relacionado do theme default: wp-content/themes/default/footer.php. O mesmo acontece para o sidebar.php, o header.php e o comments_template().</p>
<h3>Incluindo qualquer arquivo</h3>
<p>Claro que você vai querer incluir outros arquivos. Por exemplo, caso seu site tiver duas colunas, ou o seu cabeçalho for muito grande e você quiser inserir os elementos em arquivos separados. Nestes casos você pode utilizar esse código:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;?php include (TEMPLATEPATH . '/header2.php'); ?&amp;gt;</div></td></tr></tbody></table></div>
<p>O WordPress vai inserir o arquivo pedido como um include PHP normal.</p>
<p>Quer saber mais sobre WordPress? <a href="http://tableless.com.br/wordpress">Fique antenado aqui</a>!</p>
<h3  class="related_post_title">Posts Relacionados</h3><ul class="related_post"><li><a href="http://tableless.com.br/wordpress-uma-pequena-introducao/" title="Wordpress &#8211; Uma pequena introdução">Wordpress &#8211; Uma pequena introdução</a></li><li><a href="http://tableless.com.br/multiplos-backgrounds-com-css/" title="Múltiplos backgrounds com CSS">Múltiplos backgrounds com CSS</a></li><li><a href="http://tableless.com.br/colocar-rodape-fixo-no-bottom/" title="Colocar Rodapé fixo no fim da página">Colocar Rodapé fixo no fim da página</a></li><li><a href="http://tableless.com.br/convertido-menu-livraria-cultura/" title="Convertido &#8211; Menu (Livraria Cultura)">Convertido &#8211; Menu (Livraria Cultura)</a></li><li><a href="http://tableless.com.br/ah-o-maravilhoso-mundo-real/" title="Ah, o maravilhoso mundo real">Ah, o maravilhoso mundo real</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tableless.com.br/wordpress-include-tags/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Uma pequena introdução</title>
		<link>http://tableless.com.br/wordpress-uma-pequena-introducao/</link>
		<comments>http://tableless.com.br/wordpress-uma-pequena-introducao/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 02:00:07 +0000</pubDate>
		<dc:creator>Diego Eis</dc:creator>
				<category><![CDATA[Artigos]]></category>
		<category><![CDATA[Convertidos]]></category>
		<category><![CDATA[Na Prática]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[desenvolvimento web]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tableless.com.br]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[Template Tags]]></category>
		<category><![CDATA[xhtml]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://tableless.com.br/wordpress-uma-pequena-introducao</guid>
		<description><![CDATA[O WordPress não foi feito para ser um CMS. Ele foi criado primeiramente para suprir necessidades de criação de blogs. Por acaso, talvez como se fosse um acidente, começamos a utilizá-lo para criar websites, desde os mais simples até os &#8230;]]></description>
			<content:encoded><![CDATA[<p>O WordPress não foi feito para ser um CMS. Ele foi criado primeiramente para suprir necessidades de criação de blogs. Por acaso, talvez como se fosse um acidente, começamos a utilizá-lo para criar websites, desde os mais simples até os mais complicados. O pessoal do WordPress curtiu a ideia e agora está melhorando cada vez mais o sistema para que ele se torne um CMS de verdade, mesmo assim mantendo toda a simplicidade do WordPress original. E o melhor, é tudo de graça.</p>
<p>Quero mostrar aqui o caminho das pedras. O que você precisa aprender para não ficar batendo cabeça no começo. É coisa simples.</p>
<h3>Criando o index.php e o style.css</h3>
<p>Para fazer um tema de WordPress, você precisa apenas de dois arquivos: <strong>index.php</strong> e o <strong>style.css</strong>.</p>
<p>O <strong>style.css</strong> tem uma pequena sintaxe no começo do arquivo com informações do autor do Template. Essas informações serão utilizadas pelo WordPress na tela de Templates.</p>
<p>A sintaxe que está escrita no meu <strong>style.css</strong> é este:</p>
<div class="codecolorer-container css mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Você pode utilizar esse código e modificar para ficar com suas informações. Não precisa decorar<span style="color: #00AA00;">,</span> isso é coisa de maluco. <span style="color: #00AA00;">;</span>-<span style="color: #00AA00;">&#41;</span><br />
<br />
Crie um &lt;strong<span style="color: #00AA00;">&gt;</span>style.css&lt;/strong<span style="color: #00AA00;">&gt;</span> com este código dentro. Não iremos utilizar o CSS neste artigo.<br />
<br />
Crie também um &lt;strong<span style="color: #00AA00;">&gt;</span>index.php&lt;/strong<span style="color: #00AA00;">&gt;</span> com a estrutura básica de HTML. Eu utilizo sempre assim<span style="color: #00AA00;">:</span><br />
<br />
<span style="color: #00AA00;">&#91;</span>cc lang<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;html&quot;</span><span style="color: #00AA00;">&gt;</span><br />
&lt;!DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span> <br />
&nbsp; &nbsp; <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span><span style="color: #00AA00;">&gt;</span><br />
<br />
&lt;html<span style="color: #00AA00;">&gt;</span><br />
&lt;head<span style="color: #00AA00;">&gt;</span><br />
&nbsp; &nbsp; &lt;meta http-equiv<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> /<span style="color: #00AA00;">&gt;</span><br />
&nbsp; &nbsp; &lt;title<span style="color: #00AA00;">&gt;</span>&lt;/title<span style="color: #00AA00;">&gt;</span><br />
&lt;/head<span style="color: #00AA00;">&gt;</span><br />
&lt;body<span style="color: #00AA00;">&gt;</span><br />
<br />
&lt;/body<span style="color: #00AA00;">&gt;</span><br />
&lt;/html<span style="color: #00AA00;">&gt;</span></div></td></tr></tbody></table></div>
<p>Daqui para frente, irei colocar apenas o código que irá dentro do BODY do documento. Portanto, tudo que iremos ver agora, insira dentro do BODY do seu documento.</p>
<h3>As Template Tags</h3>
<p>O segredo do WordPress são as Template Tags. Você pode conferir todas aqui: <a href="http://codex.wordpress.org/Template_Tags">http://codex.wordpress.org/Template_Tags</a></p>
<p>Os templates do wordpress são escritos em PHP. Isso torna pro designer um pouco complicado, mas não muito. Se você souber um pouco de PHP, fazer um template é muito fácil, porque PHP é uma linguagem que todo mundo usa. Para facilitar, o WordPress chama as funções do PHP que são utilizadas pelo seu sistema de Template Tags. As Template Tags não passam de funções PHP que recuperam do banco, informações que você precisará para compor o conteúdo do site. Para o programador isso não muda nada. Mas para o pessoal que não é tão íntimo assim com a linguagem PHP, a forma que usamos essas &#8220;funções&#8221; (Template Tags) facilita demais.</p>
<h3>O Loop &#8211; Listando os posts na página</h3>
<p>O Loop é o responsável pelo trecho de código que será repetido para cada post impresso na tela.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</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><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>Pra você chamar os posts do blog é muito simples. Você começará utilizando duas Template Tags dentro deste código de Loop.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</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><br />
&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?</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;/h2&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> the_content<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><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>A primeira Template Tag que coloquei foi a the_title(). Ela chama os títulos dos posts do site.<br />
A segunda, the_content() chama o conteúdo dos posts. O Conteúdo vem escrito da forma que você criou no WordPress.</p>
<p>Apenas com esse código acima, você não faz um blog completo. Um blog tem outras características importantes. E são elas que iremos ver agora. </p>
<h3>Características de um Blog</h3>
<p>Há algumas características que compõem um blog. Essas características são encontradas geralmente em blogs, isso não quer dizer que em sites de notícias não podem contem essas características:</p>
<ul>
<li>Comentários</li>
<li>Categorias</li>
<li>Data, autor</li>
<li>Feed</li>
<li>Arquivo (histórico)</li>
<li>Busca</li>
<li>Permalink</li>
</ul>
<p>Não iremos mostrar em nosso código como se faz Comentários nem Categorias. O Artigo iria ficar muito mais complicado. Portanto, se estiver interessado, faça a <a href="http://visie.com.br/wordpress/" title="Oficina de WordPress da Visie">Oficina de WordPress da Visie</a>. </p>
<p>Vamos agora melhorar um bocado esse código para que o site se pareça mais com um blog.</p>
<p>Primeiro, vamos colocar Permalinks nos títulos dos posts.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</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><br />
<br />
&lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> the_permalink<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>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</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;/a&gt;&lt;/h2&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> the_content<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><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h3>Autor e Data</h3>
<p>A Template Tag que iremos utilizar é a the_author_posts_link() para Autor, que colocará a o nome do Autor com o link para seus posts. E a the_time() para colocar a data.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</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><br />
<br />
&lt;p&gt;por <span style="color: #000000; font-weight: bold;">&lt;?</span> the_author_posts_link<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> em <span style="color: #000000; font-weight: bold;">&lt;?</span> the_time<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;/p&gt;<br />
<br />
&lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> the_permalink<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>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</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;/a&gt;&lt;/h2&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> the_content<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><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>Você pode deixar a Template Tag the_time do jeito que você quiser. Ela usa aquela tabela de formatação padrão de data do PHP, você pode encontrar essa tabela aqui: http://php.net/date/<br />
Iremos formatar nossa data aqui:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</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><br />
<br />
&lt;p&gt;por <span style="color: #000000; font-weight: bold;">&lt;?</span> the_author_posts_link<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> em <span style="color: #000000; font-weight: bold;">&lt;?</span> the_time<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">/</span>m<span style="color: #339933;">/</span>Y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;<br />
<br />
&lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> the_permalink<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>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</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;/a&gt;&lt;/h2&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> the_content<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><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h3>BUSCA</h3>
<p>Para colocar um formulário de busca é muito simples. O código do formulário será:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;form action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> bloginfo<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>&quot;&gt;<br />
&lt;input name=&quot;s&quot; type=&quot;text&quot; id=&quot;busca&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #339933;">=</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'s'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;<br />
&lt;input type=&quot;submit&quot; value=&quot;Procurar&quot; /&gt;<br />
&lt;/form&gt;</div></td></tr></tbody></table></div>
<p>A Template Tag bloginfo() tráz do banco informações sobre o site. Neste caso, ele vai trazer a URL da home do site.<br />
Os inputs do formulário de busca do WordPress já vem com nomes pré-definidos, o input de busca, por exemplo, chama-se <strong>s</strong>.</p>
<p>Nosso código está assim agora.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;form action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> bloginfo<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>&quot;&gt;<br />
&lt;input name=&quot;s&quot; type=&quot;text&quot; id=&quot;busca&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #339933;">=</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'s'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;<br />
&lt;input type=&quot;submit&quot; value=&quot;Procurar&quot; /&gt;<br />
&lt;/form&gt;<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</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><br />
<br />
&lt;p&gt;por <span style="color: #000000; font-weight: bold;">&lt;?</span> the_author_posts_link<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> em <span style="color: #000000; font-weight: bold;">&lt;?</span> the_time<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">/</span>m<span style="color: #339933;">/</span>Y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;<br />
<br />
&lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> the_permalink<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>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</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;/a&gt;&lt;/h2&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> the_content<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><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h3>Arquivo e Histórico</h3>
<p>Para criar os arquivos, ou histórico, iremos utilizar a Template Tag: wp_get_archives().</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span> wp_get_archives<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></div></td></tr></tbody></table></div>
<p>Por padrão, essa Template Tag irá gerar uma lista de links dos meses que há posts. Preste bem atenção no código HTML que ele retorna. Ele cria uma lista de LI sem UL ou OL envolta.</p>
<p>Por tanto, temos que escrever dessa forma:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;ul&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span> wp_get_archives<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><br />
&lt;/ul&gt;</div></td></tr></tbody></table></div>
<p>Ele faz deste modo caso você queira colocar uma CLASS ou ID para nomear a lista.</p>
<h3>Linkando o FEED o arquivo CSS</h3>
<p>O WordPress já cria os Feeds automaticamente. O trabalho que temos é colocar um link para o que o visitante consiga copiar o endereço do RSS e cadastrar no leitor de Feeds preferido dele. Podemos oferecer em RSS, RSS 2 ou ATOM. Existem pessoas que oferecem os três formatos. Vamos oferecer apenas um formato: o RSS2.</p>
<p>A tag link tem um atributo &#8216;rel&#8217;. O atributo rel é mandatório, ele vai dizer qual será o resto da tag. Se você por exemplo colocar o valor rel=&#8221;stylesheet&#8221;, você está dizendo ao navegador que essa tag link é relativo a uma folha de estilo.</p>
<p>O valor &#8216;alternate&#8217; diz ao navegador que estamos diponibilizando o conteúdo de nosso site em um meio alternativo:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span><a href="http://www.php.net/link"><span style="color: #990000;">link</span></a> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;alternate&quot;</span> <span style="color: #339933;">...</span><br />
<span style="color: #339933;">&lt;</span><a href="http://www.php.net/link"><span style="color: #990000;">link</span></a> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;stylesheet&quot;</span> <span style="color: #339933;">...</span></div></td></tr></tbody></table></div>
<p>A tag type serve para indicar o tipo de arquivo que será carregada. No caso da folha de estillo, existem dois tipos que são utilizados hoje: o XSLT, que é utilizado para formatar código XML. E o tipo CSS, que é para formatar código HTML.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rss_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;<br />
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;</div></td></tr></tbody></table></div>
<p>Novamente iremos utilizar a tag boginfo(). Agora ela irá buscar o endereço do RSS e do CSS.</p>
<p>Perceba que utilizamos neste exemplo apenas um arquivo, o <strong>index.php</strong> para listar o conteúdo. O WordPress tem uma maneira eficaz de hierarquia de arquivos. Por exemplo: nós precisamos de um arquivo chamado archives.php para criar a lista de histórico. Na falta deste arquivo, o WordPress utiliza o <strong>index.php</strong> para criar a lista. Se tivéssemos feito o archives.php e colocado o código que utlizamos acima que cria a lista de histórico, o WordPress não utilizará o <strong>index.php</strong>.</p>
<h3  class="related_post_title">Posts Relacionados</h3><ul class="related_post"><li><a href="http://tableless.com.br/ah-o-maravilhoso-mundo-real/" title="Ah, o maravilhoso mundo real">Ah, o maravilhoso mundo real</a></li><li><a href="http://tableless.com.br/o-caminho-suave-para-o-tableless/" title="O Caminho Suave para o Tableless">O Caminho Suave para o Tableless</a></li><li><a href="http://tableless.com.br/charsets-e-encodes-tabelas-de-caracteres/" title="Charsets e Encodes &#8211; Tabelas de caracteres">Charsets e Encodes &#8211; Tabelas de caracteres</a></li><li><a href="http://tableless.com.br/pdf-sobre-produtividade/" title="PDF sobre Produtividade">PDF sobre Produtividade</a></li><li><a href="http://tableless.com.br/o-que-etableless/" title="O que é Tableless?">O que é Tableless?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tableless.com.br/wordpress-uma-pequena-introducao/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
	</channel>
</rss>

