Friday, October 28, 2011

Belajar Membuat Theme Wordpress part_2

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 :)

0 comments:

Post a Comment