on server side, this is the main function used :
function appel_crp($po) {
$li=6;
$thumb_height=140;
$thumb_width=140;
$thumb_meta="post-image";
$thumb_html="html";
$thumb_default="";
$thumb_default_show=true;
$thumb_timthumb="";
$thumb_timthumb_q="";
$scan_images=false;
if ( function_exists( 'get_crp_posts' ) )
{
$results = get_crp_posts(array ('postid' => $po, 'limit' => $li));
if ($results) {
$output='<div class="crp_related crp_related_widget crp-grid"><ul>';
foreach ($results as $result)
{
$output.="<li>";
$output .= '<a href="' . get_permalink($result->ID) . '" ' . $rel_attribute . ' ' . $target_attribute . '>';
$output .= crp_get_the_post_thumbnail(array('post' => $result->ID, 'thumb_height' => $thumb_height, 'thumb_width' => $thumb_width, 'thumb_meta' => $thumb_meta, 'thumb_html' => $thumb_html, 'thumb_default' => $thumb_default, 'thumb_default_show' => $thumb_default_show, 'thumb_timthumb' => $thumb_timthumb, 'thumb_timthumb_q' => $thumb_timthumb_q, 'scan_images' => $scan_images, 'class' => 'crp_thumb', 'filter' => 'crp_postimage'));
$output.='<span class="crp_title">';
$output.= get_the_title($result->ID);
$output.='</span>';
$output .= '</a>';
$output.="</li>";
}
$output.="</div><ul>";
return $output;
} else
return "Pas d'articles relatifs";
}
else
return "fonction inexistante";
}
the result is json encapsulated then returned to the client side and managed by javscript.