<?php
function getPosts($showposts,$tags, $thumb_key="thumb_300x166", $thumb_class, $thumb_width="300", $thumb_height="166") {
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('tag=$tags&showposts=$showposts');
while ($wp_query->have_posts()) {
$wp_query->the_post();
echo '<div class="entry"><div class="left">';
if (function_exists('get_the_image')) {
$defaults = array(
'custom_key' => array('$thumb_key'),
'image_class' => '$thumb_class',
'image_scan' => true,
'width' => '$thumb_width',
'height' => '$thumb_height'
);
get_the_image($defaults); // thumbnail
} // end if
echo '</div>
<div class="right">
<h3><a href="'.the_permalink().'">'.the_title().'</a></h3>'
.the_excerpt().'</div></div>';
} // end while
}
getPosts($showposts=5,$tags="news",$thumb_class="review-thumb");
?>
Je ne comprends pas pourquoi cette fonction de requête wordpress ne fonctionne pas. Je ne retourne/n'imprime rien du tout.La fonction PHP ne fonctionne pas comme prévu
Pourquoi ne recevons-nous jamais des questions où la fonction ** est ** fonctionnant comme prévu .... –
.. parce que personne ne veut chercher de l'aide lorsque la fonction ** fonctionne **. – 3zzy