Download - Memahami Wordpress Theme : Header.Php, Sidebar.Php Dan Footer.Php

Transcript
Page 1: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Memahami Wordpress Theme: header.php, sidebar.php, &

footer.php

Fikri Rasyid, blogginglyhttp://bloggingly.com

Page 2: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Pada dasarnya, tampilan blog dapat kita bagi

menjadi seperti ini

Page 3: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Untuk menghasilkan halaman tersebut, beginilah “kerangka” file

index.php-nya

Page 4: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Note: perhatikan baik-baik bahwa ini hanya sebatas

kerangka.

Page 5: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

=

Page 6: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Lalu dimana peran header.php, sidebar.php dan

footer.php?

Page 7: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

File index.php akan dipecah menjadi seperti ini:

•header.php•Index.php•sidebar.php•footer.php

Page 8: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php
Page 9: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

kondisi file index.php sekarang:

Page 10: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

“kalau begitu, tampilan header, sidebar dan footer-

nya hilang dong?

Page 11: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

“yap. Kalau tetap seperti ini akan hilang. Maka dari itu kita berikan Include_Tags bawaan wordpress.”

Page 12: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

“yap. Kalau tetap seperti ini akan hilang. Maka dari itu kita berikan Include_Tags bawaan wordpress.”

Page 13: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Include_Tags adalah tag wordpress yang digunakan untuk mengeksekusi perintah yang berada pada file lain.

Sederhannya, “memasukkan file lain ke dalam file”.

Page 14: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

File index.php akan menjadi

seperti ini

Page 15: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

<?php get_header(); ?> memasukkan file

header.php ke dalam index.php

Page 16: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Begitu pula dengan <?php get_sidebar(); ?> dengan sidebar.php

dan

<?php get_footer(); ?> dengan footer.php

Page 17: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Fungsinya?

Agar anda tidak perlu menulis ulang bagian header, sidebar dan

footer pada file lain.

Page 18: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Pada file archive.php,

cukup cantumkan

Include_Tags

Page 19: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Pada file single.php pun,

cukup cantumkan

Include_Tags

Page 20: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

Lebih mudah, kan?

dan menghindari pengulangan yang tidak perlu

Page 21: Memahami Wordpress Theme :  Header.Php, Sidebar.Php Dan Footer.Php

that’s itpunya pertanyaan?

reachable at:

[email protected]• fikrirasyid.com• @fikrirasyid• bit.ly/fikrirasyid-book