Dinamic in meaning in general something that fluctuates as according to condition/conditon. well, such also with theme that discussed here, that is is displaying articles kini (recent posts) without is enclosing article that being mobile/readed. in engine wordpress, display articles kini dinamicly this very easy. because fungsi- provided by wordpress. we only live to use and accustom it appropriate need.
here i shall use get_posts(). may be there that ask around, “kenapa doesn't use query_posts()? “. simple, query_posts() doesn't has parameter to filtered (exclude) id from a post. wanted routine addition to do screening.
furthermore information hit query_posts() can be seen here and get_posts() there. : )
global variable post->id
with is making use global variable post->id (that keeps id from article that read/mobile), we can do screening in another article data taking. i shall give 2 scenarioes:
1. simple
in this scenario, i want to display 7 articles kini without supplement other.
code example:
id. ’&numberposts=7? ); ? >
”>post_title? >
parameter exclude=$post->id used to filtered output data. all articles will displayed except article that has id=$post->id.
2. category equal to article
same like on, only in this scenario is that wants me display articles that has category equal to article that read/mobile. to detect id category from mobile article, i use get_the_category() then keep it in variable cat_id.
code example:
cat_id;
recents = get_posts(’category=’. cat_id. ’&exclude=’. post->id. ’&numberposts=7? ); ? >
post_title;
post_link = get_permalink($recent->id); ? >
not difficult kan?
you can direct insert code on into file sidebar. php.
Saturday, November 8, 2008
Make “recent posts” dinamic in wordpress
Subscribe to:
Post Comments (Atom)
Label Cloud
Blog Archive
-
▼
2008
(25)
-
▼
November
(13)
- Learn virus gimmick and pencegahannya”
- 8 instructions cleans virus ninja hokage”
- 5 tricks fortifies handphone from blow virus”
- 10 shortcut ms word to speed up editing”
- Make sub category at wordpress
- Make “recent posts” dinamic in wordpress
- 2 Steps protects secret data at site web”
- Manner spoonfeeds money with blog speak indonesia
- Manner spoonfeeds money with blog speak indonesia
- Popularize blog in search engine”
- Tips make blog you so nice”
- Make a living with adsense google
- speed up our house computer performance
-
▼
November
(13)
0 comments:
Post a Comment