Diseño Temas Wordpress
Diseño Temas Wordpress
This is the Chapter II of the Complete WordPress Theme Guide series. This
chapter will show you how to build a custom WordPress theme. Although the
Codex site provides very good documentations on how to create a theme, but I
find it too complicated for a beginner. In this tutorial, I will explain the basics
of how WordPress theme works and show you how to convert a static HTML
template into a theme. No PHP skill is required, but you need Photoshop and
CSS skills to create your own design.
Default
Frontpage (index.php)
Default Single
(single.php)
2. Photoshop Mockups
Based on the information gathered from the default theme, design a Photoshop mockup of your
blog. Here I'm using GlossyBlue, one of my free WordPress themes, as an example. Download the
demo.zip to see the Photoshop file.
3. HTML + CSS
After the PSD design is done, create a static HTML+CSS template of each page. You can use my
GlossyBlue HTML files in the demo.zip to follow this tutorial. Extract the zip and take a look at the
index.html, single.html, and page.html. Later in the tutorial, I will use these HTML files and convert
them into a theme.
For more details, check out Site Architecture and Template Hierarchy at Codex.
6. Style.css
Go to the WordPress default theme folder, open the style.css file. Copy the commented code at the top
and paste it to the GlossyBlue style.css file. Change the theme name and the author information as
you desire.
Go to the default theme folder, open the header.php. Copy and replace the tags where it requires PHP
code (Template Tag): <title>, <link> stylesheet, <h1>, and <div class=description>.
Navigation Menu (wp_list_pages)
Replace the <li> tags in the <ul id=nav> with <?php
wp_list_pages('sort_column=menu_order&depth=1&title_li=');?>
Reference: wp_list_pages.
9. Sidebar.php
Back to the index.html file, cut from where the <form id=searchform> start to the closing tag of
<div id=sidebar> and paste it in a new PHP file, save it as sidebar.php.
10. Footer.php
Back to the index.html file, cut from the <div id=footer> tag to the end of </html> and paste it
in a new PHP file, save it as footer.php.
Recent Posts
Here I used the query_post to display the 5 latest posts.
Recent Comments
Recent comments are generated by a plugin (included in the theme folder).
11. Index.php
Now in your index.html file, you should only have the <div id=content> wrap. Save the file as
index.php. Insert the line:get_header, get_sidebar, and get_footer in the same order as
your layout structure.
15. Single.php
Now, it is time to do the single.php template. If you want, you can go through the same process — cut
& paste from the default theme. But, I find it easier to use the index.php that you just created and save
it as single.php. Open the default theme single.php file and copy the Template Tags over. Then include
the comments_template. The image below highlights what I've changed:
16. Page.php
With the single.php template you just created, save it as page.php. Remove the post date, comment
form, next/previous link... and that's it.. there goes your page.php template.
Now, login to your admin panel, write a new page, title it Archives. On the Page Template
dropdown, select Archives.
More Reading:
Check out a list of WordPress Plugins that you may find useful. For more advance theme coding,
read my WordPress Theme Hacks.
What's Next...
In the next chapter, I will show you how to export your local WordPress to a web host and keep the
local version for backup purpose.
684 COMMENTS
Xbox 360
AUG 25, 2011 @ 22:16
Ottoman
SEP 01, 2011 @ 10:01
i war not user to comment you this article.. but i want to say that.. we want see your new
articles on this blog.. see you..
Ankara Hosting
SEP 01, 2011 @ 11:40
Well, I am so excited that I have located your post because I have been searching for some
information on this for almost three hours! You’ve helped me a lot indeed and by scaning this
post I have found many new and useful info about this subject!
Kullanılmı! Paçavra
SEP 02, 2011 @ 09:45
Thank you for any other informative website. The place else may just I get that kind of
information written in such a perfect manner? I’ve a challenge that I’m just now operating
on, and I have been on the look out for such info.thanks
Fatih Gülo"lu
SEP 02, 2011 @ 10:13
Aaaa
SEP 02, 2011 @ 10:40
i war not user to comment you this article.. but i want to say that.. we want see your new
articles on this blog.. see you..
Sdgsdg
SEP 04, 2011 @ 05:20
This site has got a lot of really useful stuff on it. Thanks for informing me.
Stephanie
SEP 07, 2011 @ 11:54
This series is the best for beginners – it’s what helped me finally “get it” and be able to create
my first WordPress theme for my portfolio. I now am a WP dev for a living. Your tutorial
series is the one I always recommend to beginners. Thanks for providing such an amazing,
easy-to-understand resource!
Asd
SEP 21, 2011 @ 06:51
If anyone wants a custom made wordpress themes please let me know. here is my fiverr.com
gig: http://fiverr.com/cmitsakis/make-a-unique-wordpress-theme you will get your own
unique wordpress theme for only $5! an insane price only for a limited time!
Melody
OCT 04, 2011 @ 18:16
Thanks for the great tutorial! I wonder what about if I don’t install wordpress locally? Instead
I have wordpress install with bluehost? That’s what I had already done. Can I still build a
custom wordpress theme? I am a 100% beginner with database and PHP.
Melody
OCT 04, 2011 @ 18:19
Hello! Thanks for the great tutorial! I wonder what about if I don’t install wordpress on my
local computer? Instead I have it install with bluehost. That’s what I had already done. Can I
still build a custom wordpress theme that way? I am not a PHP programer. I only know the
front-end coding, HTML and CSS.
FreeStuffBag
OCT 06, 2011 @ 11:02
Hello, you need to learn to modify the templates WP but in reality I have no knowledge of
PHP.
I would like to include in the index with all categories last 3 entries each. I’ll try. Thanks
friend.
Jk
OCT 07, 2011 @ 00:02
yuiu
Page
OCT 14, 2011 @ 18:35
ABO UT
Web Designer Wall is all about design, ideas, web trends, and tutorials. It is designed and maintained by Nick La,
who also runs N.Design Studio, Themify, IconDock, and Best Web Gallery.