São muitos códigos para memorizar apenas para modificar um tema do WordPress. Por isso, resolvemos criar este artigo, mostrando os códigos básicos de temas para você fazer pequenas alterações ou mesmo desenvolver seu próprio tema no WordPress. Salve esta página em seus favoritos ou imprime e cole em algum lugar da sua mesa de trabalho.
Arquivos Básicos do Modelo (Template)
Abaixo segue a lista de arquivos básicos que cada tema deve ter:
- style.css
- header.php
- index.php
- sidebar.php
- footer.php
- single.php
- page.php
- comments.php
- 404.php
- functions.php
- archive.php
- searchform.php
- search.php
Códigos em Header.php
Estes códigos são geralmente encontrados em header.php, embora alguns deles possam ser vistos ao longo dos arquivos do seu modelo. Códigos como a Localização dos Arquivos do Tema são usados para chamar URLs de imagens em todo o modelo, mesmo se passa com o código da URL exata do site. Mas a maioria destes códigos são mesmo encontrados no seu arquivo header.php.
<!--?php bloginfo('name'); ?--> – título ou Nome do Blog <!--?php wp_title(); ?--> – Título de uma Página Específica <!--?php bloginfo('url'); ?--> – URL Exata do Site <!--?php bloginfo('description'); ?--> – Descrição do Site <!--?php bloginfo('template_url'); ?--> – Localização do Tema do Site <!--?php bloginfo('stylesheet_url'); ?--> – Link para o Style.css <!--?php bloginfo('rss2_url'); ?--> – URL das Feeds RSS do Site <!--?php bloginfo('pingback_url'); ?--> – URL de Pingback do Site <!--?php bloginfo('version'); ?--> – Versão do WordPress
Códigos para Outros Arquivos do Modelo
Os códigos abaixo serão vistos em todos os arquivos do modelo, como single.php, index.php, page.php e assim por diante. É realmente fácil de chamar estes códigos para tornar seu tema dinâmico quando codificá-lo.
<!--?php get_header(); ?--> – Exibe o conteúdo do arquivo Header.php <!--?php get_footer(); ?--> – Exibe o conteúdo do arquivo Footer.php <!--?php get_sidebar(); ?--> – Exibe o conteúdo do arquivo Sidebar.php <!--?php comments_template(); ?--> – Exibe o conteúdo do arquivo Comment.php <!--?php the_content(); ?--> – Exibe o conteúdo do Post <!--?php the_excerpt(); ?--> – Exibe o trecho que foi usado no Post <!--?php the_title(); ?--> – Título do Post Específico <!--?php the_permalink() ?--> – Link do Post Específico <!--?php the_category(', ') ?--> – Categoria do Post Específico <!--?php the_author(); ?--> – Autor do Post Específico <!--?php the_ID(); ?--> – ID de um Post Específico <!--?php edit_post_link(); ?--> – Editar link para um post <!--?php next_post_link(' %link ') ?--> – URL da Próxima Página <!--?php previous_post_link('%link') ?--> – URL da Página Anterior <!--?php get_links_list(); ?--> – Lista de todos os links em Blogroll <!--?php wp_list_pages(); ?--> – Lista de todas as Páginas <!--?php wp_get_archives() ?--> – Lista de Arquivo para o Site <!--?php wp_list_cats(); ?--> – Lista de todas as Categorias <!--?php get_calendar(); ?--> – Calendário <!--?php wp_register(); ?--> – Exibe o Link de registro <!--?php wp_loginout(); ?--> – Exibe o Link Login/Logout somente para Usuários Registrados
Espero que estes códigos simples e este artigo ajude você. Por favor, não esqueça de deixar um comentário abaixo e se gostou desta página compartilhe com seus amigos nas suas redes sociais. Se não quiser perdê-la de vista, adicione aos seus favoritos.
44 respostas
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
I may need your help. I’ve been doing research on gate io recently, and I’ve tried a lot of different things. Later, I read your article, and I think your way of writing has given me some innovative ideas, thank you very much.
mexican border pharmacies shipping to usa: buying prescription drugs in mexico online – mexico drug stores pharmacies
pharmacy website india http://indiaph24.store/# online shopping pharmacy india
best online pharmacy india
best online pharmacy india https://indiaph24.store/# indian pharmacies safe
indian pharmacy
buying from online mexican pharmacy [url=http://mexicoph24.life/#]cheapest mexico drugs[/url] mexican drugstore online
https://ciprofloxacin.tech/# ciprofloxacin
cytotec pills buy online [url=https://cytotec.club/#]buy cytotec[/url] cytotec pills buy online
https://finasteride.store/# order propecia without dr prescription
https://cytotec.club/# order cytotec online
order propecia for sale: generic propecia tablets – cost generic propecia without dr prescription
buy cytotec [url=https://cytotec.club/#]buy cytotec over the counter[/url] buy cytotec over the counter
https://lisinopril.network/# buy lisinopril 20 mg online united states
http://cytotec.club/# Cytotec 200mcg price
cipro online no prescription in the usa [url=http://ciprofloxacin.tech/#]cipro for sale[/url] antibiotics cipro
ciprofloxacin generic: ciprofloxacin 500mg buy online – buy cipro online without prescription
zestril lisinopril [url=https://lisinopril.network/#]buy lisinopril 20 mg online united states[/url] lisinopril 20 mg price online
http://lisinopril.network/# lisinopril hct
http://cytotec.club/# Misoprostol 200 mg buy online
order cytotec online: Misoprostol 200 mg buy online – buy cytotec in usa
cost of cheap propecia without dr prescription [url=http://finasteride.store/#]generic propecia tablets[/url] cost of cheap propecia prices
http://cytotec.club/# purchase cytotec
effexor and tamoxifen [url=https://nolvadex.life/#]tamoxifen cost[/url] tamoxifen therapy
http://lisinopril.network/# lisinopril mexico
buy misoprostol over the counter [url=http://cytotec.club/#]cytotec buy online usa[/url] buy cytotec
purchase cipro: cipro generic – ciprofloxacin generic price
https://cytotec.club/# п»їcytotec pills online
cost propecia prices [url=http://finasteride.store/#]cost of cheap propecia[/url] cost cheap propecia without insurance
cost propecia for sale: buy propecia prices – cost generic propecia price
https://finasteride.store/# get cheap propecia without insurance
http://nolvadex.life/# nolvadex 20mg
cipro [url=http://ciprofloxacin.tech/#]cipro ciprofloxacin[/url] ciprofloxacin order online
https://finasteride.store/# cost cheap propecia without dr prescription
lisinopril 10 mg best price [url=https://lisinopril.network/#]lisinopril cheap price[/url] lisinopril 5mg
buy cipro online: purchase cipro – ciprofloxacin generic
buy 40 mg lisinopril [url=https://lisinopril.network/#]lisinopril 10 mg over the counter[/url] lisinopril cost us
https://ciprofloxacin.tech/# purchase cipro
cost cheap propecia without insurance: cost propecia tablets – buy generic propecia
http://lisinopril.network/# lisinopril diuretic
buy propecia without dr prescription [url=https://finasteride.store/#]order propecia[/url] cost of propecia online
http://finasteride.store/# buying cheap propecia without dr prescription
lisinopril generic: cost of lisinopril 40 mg – zestril tab 10mg
https://ciprofloxacin.tech/# ciprofloxacin 500 mg tablet price
cost cheap propecia without dr prescription [url=https://finasteride.store/#]order cheap propecia[/url] cost of propecia online
buy cipro [url=https://ciprofloxacin.tech/#]cipro 500mg best prices[/url] buy cipro online canada
https://finasteride.store/# order generic propecia pill
cipro online no prescription in the usa: buy cipro – ciprofloxacin generic
order cheap lisinopril [url=http://lisinopril.network/#]lisinopril price comparison[/url] lisinopril 40 mg purchase