Articoli suddivisi per categorie
-
Salve ragazzi, ho provato tanto ma non riesco, il problema è semplice, mostrare articoli per determinate categorie.
Incollo il codice dove non riesco ad inserire la giusta stringa per impostare il parametro della categoria:
global $image_thing_tags; $image_thing_tags = 'main-image-post2'; endif; $limit = 40; global $wpdb; $querystr = " SELECT distinct wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = 'closed' AND wpostmeta.meta_value = '0' AND wposts.post_status = 'publish' AND wposts.post_type = 'product' ORDER BY wposts.post_date DESC LIMIT ".$limit; $pageposts = $wpdb->get_results($querystr, OBJECT); ?> <?php $i = 0; if ($pageposts): ?> <?php global $post; ?> <?php foreach($pageposts as $post): ?> <?php setup_postdata($post); ?> <?php //Walleto_get_post(); if($view != "grid") walleto_get_post_list_view(); else Walleto_get_post(); ?> <?php endforeach; ?> <?php else : ?> <?php $no_p = 1; ?> <div class="padd100"><p class="center"><?php _e("Sorry, there are no posted products yet","Walleto"); ?>.</p></div> <?php endif; ?>Grazie
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi