Pages: [1]
  Print  
Author Topic: include / exclude template... apa2 la nama dia..  (Read 2464 times)
0 Members and 1 Guest are viewing this topic.
ikram_zidane
Full Member
***
Posts: 166


View Profile WWW
« on: November 24, 2006, 11:58:51 PM »

open up new document, then letak la kod apa2.. html je.. and any wp related tag...
then save as 'what_ever.php'

then contoh nya kat sidebar.php or kat index.php, nak masuk kan apa2 kod kat 'what_ever.php' , letak je..
Code:
<?php include (TEMPLATEPATH '/what_ever.php'); ?>
done.. ni senang nak bagi organize and bagi senang kalau nak edit only certain part kat certain document..
and boleh jugak guna untuk set number of post to be shown.. loop started yg ni...
Code:
<?php query_posts('showposts=6'); ?>
<?php while(have_posts()) : the_post(); if(!($first_post == $post->ID)) : ?>

cuz kalau letak kod ni ikut suka, boleh bercampur and mess the entire template (links not showing up, "previous and next entries" link not showing up, etc2)
Logged

good designer redesign, GREAT designer realign
http://ikram-zidane.com
mysticmind
Administrator
Hero Member
*****
Posts: 947


Lalang Di Bumi


View Profile WWW
« Reply #1 on: November 25, 2006, 12:14:57 PM »

tambah gak..

Code:
<?php include (TEMPLATEPATH '/what_ever.php'); ?>


Ok.. code nih amat berguna.. aku pun pakai..

Code:
<?php include (TEMPLATEPATH '/banner-atas.php'); ?>

Dalam theme index aku.. aku akan reserved satu area untuk banner..
jadi buat satu file nama banner-atas.php . then upload dalam korang punya theme folder yang digunakan tuh laa..

dalam banner-atas.php tuh.. kebarangkalian code cuma :
Code:
<a href="url"><img src="bannerimage"></a>

bukak file index theme korang.. edit..

nextime.. nak ubah just ubah dalam banner tuh jer..
begitu gak banner kat tepi etc.. semua bleh buat..

Logged

solidmind
Global Moderator
Hero Member
*****
Posts: 1139


www.shamrazi.com


View Profile WWW
« Reply #2 on: December 08, 2006, 09:46:27 PM »

apa fungsi benda nih???
Logged

x3ro
Full Member
***
Posts: 132



View Profile WWW
« Reply #3 on: December 08, 2006, 11:41:24 PM »

fungsi die untuk combine file php yg lain dlm satu templates..mcm <?php get_header(); ?> gak..
Logged
solidmind
Global Moderator
Hero Member
*****
Posts: 1139


www.shamrazi.com


View Profile WWW
« Reply #4 on: December 09, 2006, 12:17:43 AM »

pening jugak aku nih....
Logged

aidilx
Newbie
*
Posts: 15


View Profile
« Reply #5 on: January 16, 2009, 10:03:36 PM »

ERK? adakah code ni masih boleh digunakan ngan WP now? Undecided
Logged
mysticmind
Administrator
Hero Member
*****
Posts: 947


Lalang Di Bumi


View Profile WWW
« Reply #6 on: January 17, 2009, 04:08:53 PM »

boleh lagik.
Logged

solidmind
Global Moderator
Hero Member
*****
Posts: 1139


www.shamrazi.com


View Profile WWW
« Reply #7 on: January 17, 2009, 08:19:55 PM »

hahaha... bila baca post aku terdahulu... kelakar jer...
sekarang dah tau mana nak guna...
Logged

Tags:
Pages: [1]
  Print  
 
Jump to: