Hi Wanze,
Thanks for the reply. What I'm trying to do is whenever I read the post with Title A, the widget of Recent Posts will list all the 5 most recent posts excluding the Title A.
In widget recent posts:
$posts = $pages->find("template=post, sort=-date, start=0, limit=$limit");
$parent = null;
$out = '';
foreach($posts as $item) {
if($input->urlSegment1 == $item->title) { continue; }
$out .= "<li><a href='{$item->url}'>{$item->title}</a></li>";
$parent = $item->parent;
}
But the $input->urlSegment1 result nothing.
I'm thinking of using global variable, put the current read blog title there so I can read it in the widget. But I dont think it's the most efficient way.
Cheers.