Advertisement
miriamdepaula

Exemplo basico - Query NextGen Gallery - WordPress

Aug 4th, 2011
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. //Exemplo de query para pegar as imagens da galeria id = 1, do NextGen Gallery
  2.  
  3. $imagens = $wpdb->get_results($wpdb->prepare("SELECT ".$wpdb->prefix."ngg_pictures.pid,".$wpdb->prefix."ngg_pictures.description, ".$wpdb->prefix."ngg_pictures.alttext FROM ".$wpdb->prefix."ngg_pictures WHERE ".$wpdb->prefix."ngg_pictures.galleryid = '1' ORDER BY ".$wpdb->prefix."ngg_pictures.sortorder"), ARRAY_A);
  4.  
  5. echo "<ul id='jcarousel-galeria'>";
  6. foreach ($imagens as $imagem):
  7.  
  8.     echo "<li><img src="http://www.SEUSITE.com.br/wp-content/gallery/NOME_DA_GALERIA/". $imagem['filename']. " width="75" height="75" alt=" .$imagem['alttext']. " /></li>";
  9.  
  10. endforeach;
  11. echo "</ul>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement