function barre_navigation($nbtotal, $nbenr, $cfg_nbres_ppage, $debut, $lien, $criteres, $order) { // -------------------------------------------------------------------- $cfg_nb_pages = 10; // Nb de n° de pages affichées dans la barre $lien_on = ' <A HREF="{cible}">{lien}</A> '; $lien_off = ' {lien} '; // -------------------------------------------------------------------- //$query = $criteres.'&debut='; $query = $lien . $criteres . '&order=' . $order . '&debut='; // début << . // -------------------------------------------------------------------- if ($debut >= $cfg_nbres_ppage) { $cible = $query . 0; $image = image_html('/images/gauche_on.gif'); $lien = str_replace('{lien}', $image . $image, $lien_on); $lien = str_replace('{cible}', $cible, $lien); } else { $image = image_html('/images/gauche_off.gif'); $lien = str_replace('{lien}', $image . $image, $lien_off); } $barre .= $lien . " <B>·</B>"; // précédent < . // -------------------------------------------------------------------- if ($debut >= $cfg_nbres_ppage) { $cible = $query . ($debut - $cfg_nbres_ppage); $image = image_html('/images/gauche_on.gif'); $lien = str_replace('{lien}', $image, $lien_on); $lien = str_replace('{cible}', $cible, $lien); } else { $image = image_html('/images/gauche_off.gif'); $lien = str_replace('{lien}', $image, $lien_off); } $barre .= $lien . " <B>·</B>"; // pages 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 10 // ------------------------------------------------------------------- if ($debut >= $cfg_nb_pages * $cfg_nbres_ppage) { $cpt_fin = $debut / $cfg_nbres_ppage + 1; $cpt_deb = $cpt_fin - $cfg_nb_pages + 1; } else { $cpt_deb = 1; $cpt_fin = (int) ($nbtotal / $cfg_nbres_ppage); if ($nbtotal % $cfg_nbres_ppage != 0) { $cpt_fin++; } if ($cpt_fin > $cfg_nb_pages) { $cpt_fin = $cfg_nb_pages; } } for ($cpt = $cpt_deb; $cpt <= $cpt_fin; $cpt++) { if ($cpt == $debut / $cfg_nbres_ppage + 1) { $barre .= "<A CLASS='off'> " . $cpt . " </A> "; } else { $barre .= "<A HREF='" . $query . ($cpt - 1) * $cfg_nbres_ppage; $barre .= "'> " . $cpt . " </A> "; } } // suivant . > // -------------------------------------------------------------------- if ($debut + $cfg_nbres_ppage < $nbtotal) { $cible = $query . ($debut + $cfg_nbres_ppage); $image = image_html('/images/droite_on.gif'); $lien = str_replace('{lien}', $image, $lien_on); $lien = str_replace('{cible}', $cible, $lien); } else { $image = image_html('/images/droite_off.gif'); $lien = str_replace('{lien}', $image, $lien_off); } $barre .= " <B>·</B>" . $lien; // fin . >> // -------------------------------------------------------------------- $fin = $nbtotal - $nbtotal % $cfg_nbres_ppage; if ($nbtotal % $cfg_nbres_ppage == 0) { $fin = $fin - $cfg_nbres_ppage; } if ($fin != $debut) { $cible = $query . $fin; $image = image_html('/images/droite_on.gif'); $lien = str_replace('{lien}', $image . $image, $lien_on); $lien = str_replace('{cible}', $cible, $lien); } else { $image = image_html('/images/droite_off.gif'); $lien = str_replace('{lien}', $image . $image, $lien_off); } $barre .= "<B>·</B> " . $lien; return $barre; }
while (have_posts()) { the_post(); ?> <?php $wp_query->is_single = 1; if (is_home()) { $wp_query->is_single = 0; } ?> <div class="image"> <div class="nav prev"><?php next_post_link('%link', '‹'); ?> </div> <?php image_html(); ?> <div class="nav next"><?php if (is_home()) { $wp_query->is_single = 1; } previous_post_link('%link', '›'); if (is_home()) { $wp_query->is_single = 0; } ?> </div> </div> <?php partial('post'); ?>
function the_thumbnail() { global $post; $src = preg_replace('/\\?w\\=[0-9]+/', '?w=125', image_html(true)); $src = '<div class="image thumbnail">' . $src . '</div>'; echo $src; }