posts." AS libri
JOIN _book_order AS o ON (o.ID = libri.ID)
LEFT JOIN ".$wpdb->postmeta." AS meta ON (meta.post_id = libri.ID)
WHERE libri.post_type = 'libri'
AND libri.post_status = 'publish'
AND (
meta.meta_key = 'bk_publication_date'
AND meta.meta_value > '".$prox_date."'
)
";
if(count($excludedIDsArray)){
$querystr .= "AND libri.ID NOT IN (".implode($excludedIDsArray, ',').")";
}
$querystr .= " GROUP BY libri.ID
ORDER BY o.sticky DESC, o.sticky_priority ASC, o.publication_date DESC
LIMIT %d
";
$l = $options['rack_book_title_length'];
$querystr = $wpdb->prepare($querystr, array(
$options['to_slider_libri_prossimeuscite']
));
$pageposts = $wpdb->get_results($querystr, OBJECT);
if ($pageposts):
foreach ($pageposts as $post):
setup_postdata($post);
$aid = get_field('bk_fk_id_autore', get_the_ID());
$aid = $aid->ID;
$au_permalink = get_the_permalink($aid);
$n = get_field('au_nome', $aid);
$author = reformat_author_name($n, get_field('au_cognome' ,$aid));
$title = get_the_title();
$cover = get_field('bk_immagine', get_the_ID());
include(locate_template('racks/includes/content-book.php'));
endforeach;
else:
endif;
*/
?>