Belajar Membuat Theme WordPress


PART 1

Seperti yang sudah saya janjikan pada artikel yang kemarin http://www.binushacker.net/membuat-toggle-sederhana-css-dan-jquery.html , nah sekarang kita lanjutkan pembahasan tentang web desainnya, bahasan yang sekarang akan saya angkat yaitu Membuat theme wordpress step by step… Ini adalah PART 1 
Dikarenakan komponen dari theme wordpress itu bejibun, jadi disini saya akan membahasnya satu persatu, kenapa? selain agar kalian dapat lebih mengerti hirarki dalam tema wordpress, kalian juga akan mengerti tag tag yang dipake oleh wordpress dalam penyusunan front end nya.
Kita siapkan dulu bahan bahan yang akan kita gunakan.
=[1]= Template html dasar
[ Disini saya akan menggunakan template HTML yang sudah banyak betebaran di google, untuk download dasarnya silakan download disini http://freehtml5templates.com/downloads/free/butterflybrilliance.zip ]
=[2]= Text editor untuk mengedit template dasarnya, disini saya menggunakan Dream Weaver 8, bagi yang tidak ada silakan pake text editor e.g notepad, notepad++,
=[3]= Teh manis, camilan, rokok untuk menemani membaca artikel ini, jangan lupa puter mp3 kesayangan kalian untuk mebuat mood kalian oke….
======== Step 1 [ Pre Editing ] =========
Sebelum kita memulai mengerjakan membuat tema ini, alangkah baiknya jika kita mengenal dulu hirarki dalam tema wordpress itu.
===> Menurut wprainbow (wprainbow.com) dituliskan pada artikel
Disebut kan,
Theme Template WordPress memiliki alur eksekusi berdasarkan aturan tertentu. Artikel kali ini akan membantu anda untuk memahami alur dari Theme Template
Prasyarat yang dibutuhkan
Sebelum Anda meneruskan untuk membaca artikel ini, pastikan Anda telah membaca artikel saya sebelumnya yang berjudul Menggunakan File Theme Template dan Mengenal Anatomi WordPress Theme.
Hirarki Theme Templates
Seperti yang telah kita tahu sebelumnya bahwa sebuah WordPress Theme minimal memiliki 2 file yaitu style.css dan index.php maka ketika sebuah WordPress Theme tidak memiliki file Theme Template diatas, maka akan digantikan fungsinya oleh Theme Template lainnya berdasarkan urutan hierarki yang telah ditentukan oleh WordPress.
Misal ketika pengunjung mengakses blog, maka engine WordPress pertama kali akan mencari file Theme Template home.php. Jika WordPress Theme yang aktif sekarang tidak memiliki file home.php maka yang akan digunakan adalah file index.php. Contoh lain ketika pengunjung membuka Category tertentu maka yang pertama kali dicari oleh engine WordPress adalah file category-id.php, jika tidak ditemukan maka file category.php-lah yang akan digunakan, jika masih tidak ditemukan maka file archieve.php. Terakhir jika masih belum ditemukan maka akan menggunakan file index.php.


======== Step 2 [ Editing ] =========
Setelah kalian tadi download template html nya, sekarang extract dalam folder,
seperti yang terpampang di bagan diatas, kita bisa mengambil kesimpulan, hirarki tema wordpress paling paling sederhana, berikut susuannya.
1. Style.css
2. index.php
3. footer.php
4. header.php
5. comments.php
6. single.php
7. page.php
8. archive.php
9. functions.php
Itu lah susunan yang akan kita pakai sebagai dasarnya,
Sekarang kita cek tema html yang tadi kita download apakah sudah ada file file yang kita butuh kan itu atau belum? Yang pastinya belum, maka tugas kita selanjutnya adalah membuat file yang belum ada.
File yang sudah ada hanyalah style.css, maka untuk file yang lainya kita buat terlebih dahulu, sekarang buat file ber-extensi *php dari notepad, buat satu file “text document ” dan save as index.php
Setelah itu kita copy paste file index.php itu, buat 6 lagi, dan rename menjadi footer,header,single,page,comments,functions dan archieve.
Tugas kita selanjutnya, adalah mengisi header.php
Sekarang buka file index.html yang disertakan di temlpate html tadi, open with notepad.
berikut isi dari index.html
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8″ />
<title>ButterflyBrilliance</title>
<link rel=”stylesheet” href=”styles.css” type=”text/css” media=”screen” />
<link rel=”stylesheet” type=”text/css” href=”print.css” media=”print” />
<!–[if IE]><script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script><![endif]–>
</head>
<body>
<div id=”wrapper”><!– #wrapper –>
<header><!– header –>
<h1><a href=”#”>Butterfly Brilliance</a></h1>
<h2>Your interesting tag line goes here</h2>
</header><!– end of header –>
<nav><!– top nav –>
<div>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Support</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
</div>
</nav><!– end of top nav –>
<section id=”main”><!– #main content and sidebar area –>
<section id=”content”><!– #content –>
<article>
<h2><a href=”#”>First Article Title</a></h2>
<p><img src=”images/orangebutterfly.png” alt=”" />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
</article>
<article>
<h2><a href=”#”>Second Article Title</a></h2>
<p><img src=”images/coolbutterfly.png” alt=”" />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
<p>Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
</article>
</section><!– end of #content –>
<aside id=”sidebar”><!– sidebar –>
<h3>Things To Do</h3>
<ul>
<li><a href=”#”>Play Games</a></li>
<li><a href=”#”>Chat With Friends</a></li>
<li><a href=”#”>Swap Stories</a></li>
<li><a href=”#”>Sell Stuff</a></li>
<li><a href=”#”>Buy Stuff</a></li>
<li><a href=”#”>Trade Stuff</a></li>
</ul>
<h3>Sponsors</h3>
<img src=”images/ad125.jpg” alt=”" /><br /><img src=”images/ad125.jpg” alt=”" /><br /><br />
<h3>Connect With Us</h3>
<ul>
<li><a href=”#”>Twitter</a></li>
<li><a href=”#”>Facebook</a></li>
</ul>
</aside><!– end of sidebar –>
</section><!– end of #main content and sidebar–>
<footer>
<section id=”footer-area”>
<section id=”footer-outer-block”>
<aside>
<h4>Friends</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #first footer segment –>
<aside>
<h4>Awesome Stuff</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #second footer segment –>
<aside>
<h4>Coolness</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #third footer segment –>
<aside>
<h4>Blahdyblah</h4>
<p>&copy; 2010 <a href=”#”>yoursite.com</a> Praesent libero. Sed cursus ante dapibus diam. Sed nisi.</p>
</aside><!– end of #fourth footer segment –>
</section><!– end of footer-outer-block –>
</section><!– end of footer-area –>
</footer>
</div><!– #wrapper –>
<!– Free template created by http://freehtml5templates.com –>
</body>
</html>
Setelah terlihat isi indexnya, kita copy paste kedalam header.php
Berikut source yang akan kita copas.
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8″ />
<title>ButterflyBrilliance</title>
<link rel=”stylesheet” href=”styles.css” type=”text/css” media=”screen” />
<link rel=”stylesheet” type=”text/css” href=”print.css” media=”print” />
<!–[if IE]><script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script><![endif]–>
</head>
<body>
<div id=”wrapper”><!– #wrapper –>
<header><!– header –>
<h1><a href=”#”>Butterfly Brilliance</a></h1>
<h2>Your interesting tag line goes here</h2>
</header><!– end of header –>
<nav><!– top nav –>
<div>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Support</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
</div>
</nav><!– end of top nav –>
<section id=”main”><!– #main content and sidebar area –>
Sekarang tinggal kita edit source yang ada supaya dapat berjalan di blog wordpress kita,
<link rel=”stylesheet” href=”styles.css” type=”text/css” media=”screen” />
Seperti yang kita liat di tag diatas, tag itu tidak akan di eksekusi oleh wp engine, sekarang kita ubah sedikit agar dapat berjalan di blog wp kita
Tertulis disana href=”styles.css” jika dalam wordpress tag yang digunakan untuk memanggile style.css seperti ini <?php bloginfo (‘stylesheet_url’);?> maka dari itu, tulisan style.css kita ganti dengan tag diatas.,, maka akan menjadi seperti ini
<link rel=”stylesheet” href=”<?php bloginfo (‘stylesheet_url’);?>” type=”text/css” media=”screen” />
Disana juga terdapat *.css yang lain
<link rel=”stylesheet” type=”text/css” href=”print.css” media=”print” />
Maka untuk memanggilnya kita gunakan tag kedua,
<?php bloginfo (‘template_url’);? />
Tambahkan tag itu di depan print.css maka hasilnya seperti ini
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo (‘template_url’);?>/ print.css” media=”print” />
Oke, setelah itu kita sisipkan tag
<?php wp_head(); ?>
Sebelum </head>
Setelah itu kita SAVE.
Hasil akhirnya seperti ini
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8″ />
<title>ButterflyBrilliance</title>
<link rel=”stylesheet” href=”<?php bloginfo (‘stylesheet_url’);?>” type=”text/css” media=”screen” />
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo (‘template_url’);?>/ print.css” media=”print” /> <!–[if IE]><script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script><![endif]–>
</head>
<body>
<div id=”wrapper”><!– #wrapper –>
<header><!– header –>
<h1><a href=”#”>Butterfly Brilliance</a></h1>
<h2>Your interesting tag line goes here</h2>
</header><!– end of header –>
<nav><!– top nav –>
<div>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Support</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
</div>
</nav><!– end of top nav –>
<section id=”main”><!– #main content and sidebar area –>
Sebelum kita lanjut pada tahap selanjutnya, sedikit akan saya bahas apa saja sih yang bisa dimasukan kedalah header.php ini??
Disini kita bisa sisipkan favicon.
Contoh pemanggilan faviconya seperti ini
<link rel=”shortcut icon” href=”<?php bloginfo(‘template_directory’); ?>/favicon.ico” />
Untuk perjumpaan yang sekarang saya cukupkan sampai disini dulu, udah magrib, saatnya saya untuk mandi dan solat, so kita lanjutkan pada perjumpaan yang selanjutnya..
Oke, have a niceday and GBU

PART 2

Oke kawan, selamat morning, kali ini kita akan membahas Belajar Membuat Theme WordPress Part 2.
Kita awali pagi dengan senyuman, oke :D
Oke, sebelum kita lanjutkan pembahasan yang kemaren, http://www.binushacker.net/belajar-membuat-theme-wordpress-p1.html, mungkin diantara kalian yang membaca dan menyimak tutor ini bertanya tanya, kenapa tag html nya berbeda dari html yang biasa kita jumpai?
Jadi begini kawan, dunia internet semakin berkembang, dan para developer web pun mengembangkan source supaya lebih mudah dan simple, maka dari itu, sedikit demi sedikit saya akan membiasakan dalam tutor desain yang saya berikan itu menggunakan HTML5+css3, karena dalam dalam dunia webdis (web desain) source ini sedang di gandrungi :D
Oke, sekarang kita lanjut ke step selanjutnya….
Setelah kemaren kita membuat file header.php
Sekarang kita akan membuat pasanganya, yaitu footer.php
Sedikit kita review… tag index yang kemaren…
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8″ />
<title>ButterflyBrilliance</title>
<link rel=”stylesheet” href=”styles.css” type=”text/css” media=”screen” />
<link rel=”stylesheet” type=”text/css” href=”print.css” media=”print” />
<!–[if IE]><script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script><![endif]–>
</head>
<body>
<div id=”wrapper”><!– #wrapper –>
<header><!– header –>
<h1><a href=”#”>Butterfly Brilliance</a></h1>
<h2>Your interesting tag line goes here</h2>
</header><!– end of header –>
<nav><!– top nav –>
<div>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Support</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
</div>
</nav><!– end of top nav –>
<section id=”main”><!– #main content and sidebar area –>
<section id=”content”><!– #content –>
<article>
<h2><a href=”#”>First Article Title</a></h2>
<p><img src=”images/orangebutterfly.png” alt=”” />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
</article>
<article>
<h2><a href=”#”>Second Article Title</a></h2>
<p><img src=”images/coolbutterfly.png” alt=”” />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
<p>Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
</article>
</section><!– end of #content –>
<aside id=”sidebar”><!– sidebar –>
<h3>Things To Do</h3>
<ul>
<li><a href=”#”>Play Games</a></li>
<li><a href=”#”>Chat With Friends</a></li>
<li><a href=”#”>Swap Stories</a></li>
<li><a href=”#”>Sell Stuff</a></li>
<li><a href=”#”>Buy Stuff</a></li>
<li><a href=”#”>Trade Stuff</a></li>
</ul>
<h3>Sponsors</h3>
<img src=”images/ad125.jpg” alt=”” /><br /><img src=”images/ad125.jpg” alt=”” /><br /><br />
<h3>Connect With Us</h3>
<ul>
<li><a href=”#”>Twitter</a></li>
<li><a href=”#”>Facebook</a></li>
</ul>
</aside><!– end of sidebar –>
</section><!– end of #main content and sidebar–>
<footer>
<section id=”footer-area”>
<section id=”footer-outer-block”>
<aside>
<h4>Friends</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #first footer segment –>
<aside>
<h4>Awesome Stuff</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #second footer segment –>
<aside>
<h4>Coolness</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #third footer segment –>
<aside>
<h4>Blahdyblah</h4>
<p>&copy; 2010 <a href=”#”>yoursite.com</a> Praesent libero. Sed cursus ante dapibus diam. Sed nisi.</p>
</aside><!– end of #fourth footer segment –>
</section><!– end of footer-outer-block –>
</section><!– end of footer-area –>
</footer>
</div><!– #wrapper –>
<!– Free template created by http://freehtml5templates.com –>
</body>
</html>
Dari source diatas kita akan ambil bagian footernya,
Here we go……..
</section><!– end of #main content and sidebar–>
<footer>
<section id=”footer-area”>
<section id=”footer-outer-block”>
<aside>
<h4>Friends</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #first footer segment –>
<aside>
<h4>Awesome Stuff</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #second footer segment –>
<aside>
<h4>Coolness</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #third footer segment –>
<aside>
<h4>Blahdyblah</h4>
<p>&copy; 2010 <a href=”#”>yoursite.com</a> Praesent libero. Sed cursus ante dapibus diam. Sed nisi.</p>
</aside><!– end of #fourth footer segment –>
</section><!– end of footer-outer-block –>
</section><!– end of footer-area –>
</footer>
</div><!– #wrapper –>
<!– Free template created by http://freehtml5templates.com –>
</body>
</html>
Dalam footer ini ga ada yang aneh, secara keseluruhan hampir sama dengan header, so just place this code<?php wp_footer(); ?> before </body>,
Berikut fungsi wp_footer menurut
http://www.wpdesigner.com
The wp_footer() function is often used by plugins to insert PHP codes after everything else on your page. According to WordPress.org theme development documentation, you should place the wp_footer() function in the footer, which would be in the footer.php file.
One detail that WordPress.org doesn’t mention is that most plugins (i.e: Spam Karma 2, PodPress, and FireStats), using the wp_footer() function, tend to break your theme. A well-designed and well-built theme is nothing without a safely placed wp_footer() function.
Here’s my advice. Don’t place the wp_footer() function right before the end; that’s usually the closing body tag. Instead, place that function within a DIV or container. For example:
Posts
Sidebar

If you do that, no matter what a certain plugin does to the footer of your theme, it doesn’t expand beyond the container or DIV containing the wp_footer() function. You can open up the footer.php file of the Greed theme for an example.
Update:
Place the wp_footer() function within a style-less container (usually the outermost div with no backgrounds and images) that your layout doesn’t depend on. Otherwise, you might end up with an incomplete layout while waiting for a slow loading plugin.
Jadi secara harfiah fungsi dari wp_footer adalah sebagai tolak ukur penggunaan plug-in jika ingin plug-in nya itu berjalan seperti sebagai mana mestinya.
Jadi final source untuk footer.php ada lahah seperti ini.
</section><!– end of #main content and sidebar–>
<footer>
<section id=”footer-area”>
<section id=”footer-outer-block”>
<aside>
<h4>Friends</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #first footer segment –>
<aside>
<h4>Awesome Stuff</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #second footer segment –>
<aside>
<h4>Coolness</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #third footer segment –>
<aside>
<h4>Blahdyblah</h4>
<p>&copy; 2010 <a href=”#”>yoursite.com</a> Praesent libero. Sed cursus ante dapibus diam. Sed nisi.</p>
</aside><!– end of #fourth footer segment –>
</section><!– end of footer-outer-block –>
</section><!– end of footer-area –>
</footer>
<?php wp_footer(); ?>
</div><!– #wrapper –>
<!– Free template created by http://freehtml5templates.com –>

</body>
</html>
So thats all our leason for today, hope you understand.
And than have a great day and GBU
See ya in next step….
PS: Untuk berdiskusi silakan ke: http://forum.binushacker.net :)

PART 3

Malam, begadang nih, dari pada ga ada kerjaan mending kita lanjutin materi yang sebelumnya gue bahas yaitu membuat footer.php
langsung aja dah,
Step selanjutnya adalah membuat isian dari index.php
Sebelumnya kita ulas dulu isi dari header.php dan footer.php
header.php
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8″ />
<title>ButterflyBrilliance</title>
<link rel=”stylesheet” href=”<?php bloginfo (‘stylesheet_url’);?>” type=”text/css” media=”screen” />
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo (‘template_url’);?>/ print.css” media=”print” /> <!–[if IE]><script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”></script><![endif]–>
</head>
<body>
<div id=”wrapper”><!– #wrapper –>
<header><!– header –>
<h1><a href=”#”>Butterfly Brilliance</a></h1>
<h2>Your interesting tag line goes here</h2>
</header><!– end of header –>
<nav><!– top nav –>
<div>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Support</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
</div>
</nav><!– end of top nav –>
<section id=”main”><!– #main content and sidebar area –>
footer.php
</section><!– end of #main content and sidebar–>
<footer>
<section id=”footer-area”>
<section id=”footer-outer-block”>
<aside>
<h4>Friends</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #first footer segment –>
<aside>
<h4>Awesome Stuff</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #second footer segment –>
<aside>
<h4>Coolness</h4>
<ul>
<li><a href=”#”>one linkylink</a></li>
<li><a href=”#”>two linkylinks</a></li>
<li><a href=”#”>three linkylinks</a></li>
</ul>
</aside><!– end of #third footer segment –>
<aside>
<h4>Blahdyblah</h4>
<p>&copy; 2010 <a href=”#”>yoursite.com</a> Praesent libero. Sed cursus ante dapibus diam. Sed nisi.</p>
</aside><!– end of #fourth footer segment –>
</section><!– end of footer-outer-block –>
</section><!– end of footer-area –>
</footer>
<?php wp_footer(); ?>
</div><!– #wrapper –>
<!– Free template created by http://freehtml5templates.com –>
</body>
</html>
Oke sekarang kita buat index nya, buka file index.php nya
Dan masukan 2 code ini:
<?php get_header()?>
<?php get_footer();?>
Sekarang buka file index.html dari tema yang kemaren kita download dan copy paste code ini di antara kedua code diatas,dan hasilnya seperti ini.
<?php get_header()?>
<section id=”content”><!– #content –>
<article>
<h2><a href=”#”>First Article Title</a></h2>
<p><img src=”images/orangebutterfly.png” alt=”” />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
</article>
<article>
<h2><a href=”#”>Second Article Title</a></h2>
<p><img src=”images/coolbutterfly.png” alt=”” />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
<p>Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Maurismassa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
</article>
</section><!– end of #content –>
<aside id=”sidebar”><!– sidebar –>
<h3>Things To Do</h3>
<ul>
<li><a href=”#”>Play Games</a></li>
<li><a href=”#”>Chat With Friends</a></li>
<li><a href=”#”>Swap Stories</a></li>
<li><a href=”#”>Sell Stuff</a></li>
<li><a href=”#”>Buy Stuff</a></li>
<li><a href=”#”>Trade Stuff</a></li>
</ul>
<h3>Sponsors</h3>
<img src=”images/ad125.jpg” alt=”” /><br /><img src=”images/ad125.jpg” alt=”” /><br /><br />
<h3>Connect With Us</h3>
<ul>
<li><a href=”#”>Twitter</a></li>
<li><a href=”#”>Facebook</a></li>
</ul>
</aside><!– end of sidebar –>
<?php get_footer();?>
Sampai disini sebenarnya template ini sudah siap di tes (tapi belum layak pakai)
Tugas kita selanjutnya adalah menampilkan hasil dari postingan kita.
Seperti yang tertulis dari code index diatas, disana terdapat dua tag article, kita buang saja satu,
Hasilnya seperti ini:
<?php get_header()?>
<section id=”content”><!– #content –>
<article>
<h2><a href=”#”>First Article Title</a></h2>
<p><img src=”images/orangebutterfly.png” alt=”” />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
</article>

</section><!– end of #content –>
<aside id=”sidebar”><!– sidebar –>
<h3>Things To Do</h3>
<ul>
<li><a href=”#”>Play Games</a></li>
<li><a href=”#”>Chat With Friends</a></li>
<li><a href=”#”>Swap Stories</a></li>
<li><a href=”#”>Sell Stuff</a></li>
<li><a href=”#”>Buy Stuff</a></li>
<li><a href=”#”>Trade Stuff</a></li>
</ul>
<h3>Sponsors</h3>
<img src=”images/ad125.jpg” alt=”” /><br /><img src=”images/ad125.jpg” alt=”” /><br /><br />
<h3>Connect With Us</h3>
<ul>
<li><a href=”#”>Twitter</a></li>
<li><a href=”#”>Facebook</a></li>
</ul>
</aside><!– end of sidebar –>
<?php get_footer();?>
Sekarang kita akan memasangkan jamu pemanggil postingan kita,
Here we go…..
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<?php endif; ?>
Kita pasangkan di tag article kita, final code is right here.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php endwhile; ?>
<?php endif; ?>
Jadi hasil dari kerja kita malam ini menghasilkan source index.php seperti ini:
<?php get_header()?>
<section id=”content”><!– #content –>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php endwhile; ?>
<?php endif; ?>

</section><!– end of #content –>
<aside id=”sidebar”><!– sidebar –>
<h3>Things To Do</h3>
<ul>
<li><a href=”#”>Play Games</a></li>
<li><a href=”#”>Chat With Friends</a></li>
<li><a href=”#”>Swap Stories</a></li>
<li><a href=”#”>Sell Stuff</a></li>
<li><a href=”#”>Buy Stuff</a></li>
<li><a href=”#”>Trade Stuff</a></li>
</ul>
<h3>Sponsors</h3>
<img src=”images/ad125.jpg” alt=”” /><br /><img src=”images/ad125.jpg” alt=”” /><br /><br />
<h3>Connect With Us</h3>
<ul>
<li><a href=”#”>Twitter</a></li>
<li><a href=”#”>Facebook</a></li>
</ul>
</aside><!– end of sidebar –>
<?php get_footer();?>
Untuk sekarang di cukupkan dulu, kita akan lanjutkan nanti pada tahap pembuatan single.php
So keep stay in www.BinusHacker.net for more useable article.
Good nite and have a great dream to night.
See ya :)

PART 4

Yah baru sempet posting lagi.. beberapa hari ini agak disibukan ma tunggakan tugas yang udah musti kelar buat sarat ikut UAS, ditambah lagi repot beresin porum komunitas, tutor nya jadi terbengkalai dah….
Berhubung hutang itu harus di bayar, jadi ane lanjutin lagi dah tutor nya…
Mungkin dari kalian semua ada yang berpendapat kenapa tutor nya ga disatuin aja, kenapa musti dibagi bagi gini??
gini gan, dulu ane pernah singgah disalah satu blog tutor, disana menerapkan one week one content.dan itu ternyata berhasil, karena kita akan lebih fokus dalam satu ulasan itu, tanpa terpengaruh oleh yang lain, nah konsep seperti itu mulai ane terapin dihampir semua site garapan ane,ane harap sih, kalian semua bisa menerima cara penyampaian yang ane jalankan, sukur sukur agan semua kaga puas dengan apa yang udah ane sampein, jadi bisa bertanya dan lebih ngulik lagi soal bahasanya, tambah banyak kan tambah ilmu. right?
Lanjut setelah kemaren kita buat index.php..
http://www.binushacker.net/belajar-membuat-theme-wordpress-p3.html
Enaknya kita ngelancong kemana dulu ya??
Yang pendek pendek dulu aja kalia ya.. oke deh,, hari ini kita akan bahas sidebar.php
Sebelum nya review dulu isian dari idex.php
index.php
<?php get_header()?>
<section id=”content”><!– #content –>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php endwhile; ?>
<?php endif; ?>

</section><!– end of #content –>
<aside id=”sidebar”><!– sidebar –>
<h3>Things To Do</h3>
<ul>
<li><a href=”#”>Play Games</a></li>
<li><a href=”#”>Chat With Friends</a></li>
<li><a href=”#”>Swap Stories</a></li>
<li><a href=”#”>Sell Stuff</a></li>
<li><a href=”#”>Buy Stuff</a></li>
<li><a href=”#”>Trade Stuff</a></li>
</ul>
<h3>Sponsors</h3>
<img src=”images/ad125.jpg” alt=”” /><br /><img src=”images/ad125.jpg” alt=”” /><br /><br />
<h3>Connect With Us</h3>
<ul>
<li><a href=”#”>Twitter</a></li>
<li><a href=”#”>Facebook</a></li>
</ul>
</aside><!– end of sidebar –>
<?php get_footer();?>
Dalam html5, sudah disediakan tag sidebar, yaitu “aside” jadi kita buka file sidebar.php
dan index.php nya,
Cut code ini dari index.php
<aside id=”sidebar”><!– sidebar –>
<h3>Things To Do</h3>
<ul>
<li><a href=”#”>Play Games</a></li>
<li><a href=”#”>Chat With Friends</a></li>
<li><a href=”#”>Swap Stories</a></li>
<li><a href=”#”>Sell Stuff</a></li>
<li><a href=”#”>Buy Stuff</a></li>
<li><a href=”#”>Trade Stuff</a></li>
</ul>
<h3>Sponsors</h3>
<img src=”images/ad125.jpg” alt=”” /><br /><img src=”images/ad125.jpg” alt=”” /><br /><br />
<h3>Connect With Us</h3>
<ul>
<li><a href=”#”>Twitter</a></li>
<li><a href=”#”>Facebook</a></li>
</ul>
</aside><!– end of sidebar –>
Dan paste-kan di sidebar.php
Sekarang buka lagi file index.php nya, kita akan masukan tak pemanggil sidebar.
Here we go….
<?php get_sidebar(); ?>
Nah, sekarang pasang fungsi itu di index.php
Jadinya seperti ini….
<?php get_header()?>
<section id=”content”><!– #content –>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php endwhile; ?>
<?php endif; ?>

</section><!– end of #content –>
<?php get_sidebar(); ?><?php get_footer();?>
Setelah itu save file index.phpnya, sekarang buka file sidebar.php
Nah berikut fungsi yang biasa diisikan di file sidebar.php
  1. <?php wp_list_pages(‘title_li=<h2>Pages</h2>’); ?>
  2. <?php wp_list_cats(); ?>
  3. <?php wp_get_archives(‘type=monthly’); ?>
  4. <?php related_posts(10, 10, ‘<li>’, ‘</li>’, ”, ”, false, false); ?>
Fungsi diatas masih bisa agan semua modifikasi lagi,silakan lihathttp://codex.wordpress.org/Customizing_Your_Sidebar jika ingin mengetahui lebih dalam tentang costumasi sidebar. untuk sekarang saya hanya akan menggunakan sebagian saja biar tidak riweuh… wkwkwk :D
Ini hasil akhir untuk file sidebar.php
<aside id=”sidebar”><!– sidebar –>
<h3>
<?php _e(‘Categories:’); ?>
</h3>
<ul>
<?php wp_list_categories(‘title_li=‘); ?>
</ul>
<h3>
<?php _e(‘Pages:’); ?>
</h3>
<ul>
<?php wp_list_pages(‘title_li=’); ?>
</ul>
<h3>
<?php _e(‘Archiev:’); ?>
</h3>
<ul>
<?php wp_get_archives(‘type=monthly’); ?>
</ul>
</aside><!– end of sidebar –>
Save and done…
Oke cukup dulu ah....
Mau lanjut lagi ngerjain makalah. so keep stay @ binushacker.net
and see ya.
GBU

PART 5

Yang langsung nyantol di link ini, nih ane kasih part part sebelum mulai beranjak untuk membaca part 5 ini. silakan di pelajari dan di komentari :D
Kemaren kita udah buat file sidebar.php, dan berhubung sekarang waktu ane sangat sangat singkat banget, jadi kita mulai dengan hal file yang simple dulu kali ye…
Oke yang sekarang akan kita bahas adalah membuat file comments.php
Berhubung ane sendiri sampe sekarang masih agak bingung tentang costumasi file comments.php jadi ane kasih mentahnya aja untuk kalian copas di file comments.php yang sebelumnya telah kita buat.
Silakan pastekan function ini di comments.php

<?php // Do not delete these lines
if (‘comments.php’ == basename($_SERVER['SCRIPT_FILENAME']))
die (‘Please do not load this page directly. Thanks!’);
if (!empty($post->post_password)) { // if there’s a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn’t match the cookie
?>
<p>This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = ”;
?>
<!– You can start editing here. –>
<?php if ($comments) : ?>
<h2 id=”comments”>Comments</h2>
<div>
<?php wp_list_comments2(); ?>
</div>
<?php else : // this is displayed if there are no comments so far ?>
<?php if (‘open’ == $post->comment_status) : ?>
<!– If comments are open, but there are no comments. –>
<?php else : // comments are closed ?>
<!– If comments are closed. –>
<p>Comments are closed.</p>
<?php endif; ?>
<?php endif; ?>
<?php if (‘open’ == $post->comment_status) : ?>
<div id=”respond”>
<h3 id=”respond_title”>Post a comment</h3>
<div>
<small><?php cancel_comment_reply_link(); ?></small>
</div>
<?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
<p>You must be <a href=”<?php echo get_option(‘siteurl’); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>”>logged in</a> to post a comment.</p>
<?php else : ?>
<form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method=”post” id=”commentform”>
<div>
<?php theme_google_300_ads_show(); ?>
</div>
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href=”<?php echo get_option(‘siteurl’); ?>/wp-admin/profile.php”><?php echo $user_identity; ?></a>. <a href=”<?php echo wp_logout_url(get_permalink()); ?>” title=”Log out of this account”>Log out &raquo;</a></p>
<?php else : ?>
<p><input type=”text” name=”author” id=”author” value=”<?php echo $comment_author; ?>” size=”22″ tabindex=”1″ <?php if ($req) echo “aria-required=’true’”; ?> />
<label for=”author”><small>Name <?php if ($req) echo “(required)”; ?></small></label></p>
<p><input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email; ?>” size=”22″ tabindex=”2″ <?php if ($req) echo “aria-required=’true’”; ?> />
<label for=”email”><small>Mail (will not be published) <?php if ($req) echo “(required)”; ?></small></label></p>
<p><input type=”text” name=”url” id=”url” value=”<?php echo $comment_author_url; ?>” size=”22″ tabindex=”3″ />
<label for=”url”><small>Website</small></label></p>
<?php endif; ?>
<!–<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>–>
<p><textarea name=”comment” id=”comment” cols=”100%” rows=”10″ tabindex=”4″></textarea></p>
<p><input name=”submit” type=”image” src=”<?php bloginfo(‘template_url’)?>/images/comm_sub.gif” id=”submit” tabindex=”5″ value=”Submit Comment” />
<?php comment_id_fields(); ?>
</p>
<?php do_action(‘comment_form’, $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>
Dari pengalaman ane selama ini mengostumasi file comments.php, ane hanya mengetahui beberapa dari ratusan bahkan ribuat trik untuk membuat menarik comments kalian…
Kalian bisa mempercantik tag tag html nya dengan mengcostumasinya di style.css
So thats it for today.
Semoga kalian tidak puas dan terus bertanya.
Stay connect with us @ http://www.binushacker.net
See ya and have a nice day…… :)

PART 6

Yo yo yo. selamat malam kawan semuanya…. mari kita lanjutkan pembelajaran kita pada pembahasan pembuatan tema wordpress.
Ga kerasa sekarang itu udah memasuki tuto yang part 6,
Yang sekarang akan kita bahas adalah cara membuat file single.php, oh iye, tutor ini ane dah susun mulai dari depan hingga belakang secara berurutan, seperti pada part 1 kita membahas membuat header, dan footer pada part 2, dilanjutkan dengan index pada part 3, disusul oleh sidebar pada part 4, dan comments pada part 5, jadi menurut hemat saya, maka selanjutnya adalah single, so lets start….
pada dasarnya, single.php itu sama dengan index.php hanya saja ada beberapa tambahan pada page single. seperti komentar, similiar post, etc.
Jadi untuk membuat single.php kita buka dulu file index.php
Dan copas isinya ke single.php….
Berikut adalah isi dari index.php renewal yang udah di refisi pada part 4,
<?php get_header()?>
<section id=”content”><!– #content –>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php endwhile; ?>
<?php endif; ?>

</section><!– end of #content –>
<?php get_sidebar(); ?><?php get_footer();?>

Nah sekarang tambah kan code pemanggil comment
Berikut code nya…
<?php comments_template(); ?>
Letakan sebelum endwhile, maka hasil akhirnya seperti ini…
<?php get_header()?>
<section id=”content”><!– #content –>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php comments_template(); ?>
<?php endwhile; ?>
<?php endif; ?>

</section><!– end of #content –>
<?php get_sidebar(); ?><?php get_footer();?>
Save code diatas dengan nama single.php,
Mudah kan.. oke sekarang mah belajarnye pendek pendek aje dulu ye.. cz takut muntah klo di jejelin bejibun code dalam sekali lahap, Pelan pelan aje ye, supaya tar kalian pada bisa dan berkarya dengan ilmu,,
So thats it for today..
I’ll teach you all in next meeting..
Have a great day, and see ya…
NB : keep learning and join us @ forum.binushacke.net

PART 7

Selamat malam semuanye… pa kabar nih?? bertemu lagi dengan angga a.k.a anggamovic, setelah kemaren kita buat file single.php sekarang kita akan membahas page.php
Sebenernye sama aja dengan single.php cuma page.php ini akan didipake sebagai default page yang kita buat.
Sekarang kita buka lagi file single.php nya.. dan copy semua source yang ada, copas ke file page.php
Maka file page.php akan menjadi seperti ini
<?php get_header()?>
<section id=”content”><!– #content –>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php comments_template(); ?>
<?php endwhile; ?>
<?php endif; ?>
</section><!– end of #content –>
<?php get_sidebar(); ?><?php get_footer();?>
Ada satu lagi trik di file page.php ini. ane nemu trik ini setelah beberapa waktu lalu ane mau buat page galery di blog ane, tapi rasanya canggung klo pake template page bawaan tema. makanya ane cari sumber lain dan ga jauh jauh.. ketemunye di instalan wordpress juga, tepatnye di tema bawaan wordpress.. nah hal yang perlu kalian tambahkan untuk membuat page yang kalian ingin kan dan pastinya beda dari page.php yang ada. silakan kalian modifikasi sebagus mungkin file page.php nya. setelah itu save as, ubah namanya terserah kalian, disini saya kasih contoh galery.php nah setelah itu kalian tambah kan code ini tepat di atas
<?php get_header();?>

Berikut codenya
<?php /*
Template Name: Galery
*/ ?>
Nah jadinya seperti ini

<?php /*
Template Name: Galery
*/ ?>

<?php get_header()?>
<section id=”content”><!– #content –>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h2>
<p><img src=”<?php bloginfo(‘template_directory’); ?>/images/orangebutterfly.png” alt=”” />
<?php the_content(‘Read more &raquo;’); ?></p>
</article>
<?php comments_template(); ?>
<?php endwhile; ?>
<?php endif; ?>
</section><!– end of #content –>
<?php get_sidebar(); ?><?php get_footer();?>

Oke untuk kostumasinya saya akan tampilkan jika tutorial ini sudah selesai dan tema hasil buatan kita ..
So have a nice day and nice day
Dont Forget To Join Forum BinusHacker :)

PART 8

Seperti yang sudah ane janjiin dulu di pagenya B|H di facebook bahwa ane akan bahas tentangfunctions.php di wordpress, nah pertemuan sekarang ane akan sedikit mengulas tentang functions.php, pada dasarnya functions.php adalah file yang berisi perintah tambahan untuk blog kita. dan disini kita bisa melakukan segala hal untuk blog kita. bisa dibilang ini adalah nyawa ketiga blog kita setelah hosting dan theme….

So lets begin
Completely remove the version number from pages and feeds
// remove version info from head and feeds
function complete_version_removal() {
return ”;
}
add_filter(‘the_generator’, ‘complete_version_removal’);
Customize the admin footer message
// customize admin footer text
function custom_admin_footer() {
echo ‘Website Design by Monzilla Media’;
}
add_filter(‘admin_footer_text’, ‘custom_admin_footer’);
Enable delete and spam links for comments
// spam & delete links for all versions of wordpress
function delete_comment_link($id) {
if (current_user_can(‘edit_post’)) {
echo ‘| del ‘;
echo ‘| spam’;
}
}
dan tambah kan ini di cooments loop nya
Disable all WordPress feeds
// disable all feeds
function fb_disable_feed() {
wp_die(__(‘

Feed not available, please visit our Home Page!

‘));
}
add_action(‘do_feed’, ‘fb_disable_feed’, 1);
add_action(‘do_feed_rdf’, ‘fb_disable_feed’, 1);
add_action(‘do_feed_rss’, ‘fb_disable_feed’, 1);
add_action(‘do_feed_rss2′, ‘fb_disable_feed’, 1);
add_action(‘do_feed_atom’, ‘fb_disable_feed’, 1);
Add feed links to header
// add feed links to header
if (function_exists(‘automatic_feed_links’)) {
automatic_feed_links();
} else {
return;
}
Enable threaded comments
// enable threaded comments
function enable_threaded_comments(){
if (!is_admin()) {
if (is_singular() AND comments_open() AND (get_option(‘thread_comments’) == 1))
wp_enqueue_script(‘comment-reply’);
}
}
add_action(‘get_header’, ‘enable_threaded_comments’);
Remove unwanted crap from the head section
// remove junk from head
remove_action(‘wp_head’, ‘rsd_link’);
remove_action(‘wp_head’, ‘wp_generator’);
remove_action(‘wp_head’, ‘feed_links’, 2);
remove_action(‘wp_head’, ‘index_rel_link’);
remove_action(‘wp_head’, ‘wlwmanifest_link’);
remove_action(‘wp_head’, ‘feed_links_extra’, 3);
remove_action(‘wp_head’, ‘start_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘parent_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0);
Add a different favicon for your blog’s Admin area
// add a favicon for your admin
function admin_favicon() {
echo ”;
}
add_action(‘admin_head’, ‘admin_favicon’);
Custom Admin Login logo
// custom admin login logo
function custom_login_logo() {
echo ‘
h1 a { background-image: url(‘.get_bloginfo(‘template_directory’).’/images/custom-login-logo.png) !important; }
‘;
}
add_action(‘login_head’, ‘custom_login_logo’);
Disable unused widget areas
// disable all widget areas
function disable_all_widgets($sidebars_widgets) {
//if (is_home())
$sidebars_widgets = array(false);
return $sidebars_widgets;
}
add_filter(‘sidebars_widgets’, ‘disable_all_widgets’);
Kill the WordPress update nag
// kill the admin nag
if (!current_user_can(‘edit_users’)) {
add_action(‘init’, create_function(‘$a’, “remove_action(‘init’, ‘wp_version_check’);”), 2);
add_filter(‘pre_option_update_core’, create_function(‘$a’, “return null;”));
}
Sekarang tinggal di masukan kepada file functions.php dan walah,, jadilah tema yang selama ini jadi tutorial kita.. untuk demo nya menyusul ya, cz belum ane susun…

UPDATE Versi E-Book!

Buat yang menunggu versi ebook nya ini suadah saya buat kan, jadi silakan di dikmati. Dan untuk versi videonya sedang di garap.. so sabar :)
Dowload di Link Berikut untuk Ebooknya:

Posting Komentar

Lebih baru Lebih lama

Formulir Kontak