Problemi con query_posts
-
Buongiorno, sto cercando di modificare il template gratuito work-a-holic di graphpaper e trovo alcuni problemi nel poter definire i post da visualizzare nel loop della home page.
In pratica all’interno di questo loop<?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
query_posts(‘cat=-‘ . $blog_ID. ‘&paged=’.$paged);
while (have_posts()) : the_post();$i++;?><div class=”portfolio grid_4<?php if ($i == 1) { ?> alpha<?php } else if($i==3) {?> omega<?php $i = 0;} ?>”>
<h4>” class=”thumb”>
<?php
if (get_post_meta($post->ID, ‘thumbnail-wide’, true)) { // pulls from WP Post Thumbnail Plugin ?>
<img src=”<?php echo get_post_meta($post->ID, ‘thumbnail-wide’, true); ?>” width=”284″ height=”150″ border=”0″ />
<?php }else{
postimage(‘thumbnail’);
} ?>
<span class=”category”><?php the_category(‘ + ‘); ?></span></h4>
</div>vorrei cambiare il parametro “cat=” nella riga 2 con un parametro tag, post o qualcosa di simile per poter avere in home sempre gli stessi 6 post (in modo da avere delle sezioni fisse).
Il problema è che la query non sembra accettare nessun altro parametro se non cat.
Ho provato con tag (assegnando un tag ai post che mi interessa visualizzare), ho provato con il post id (paarametro ‘p’), ho provato a combinare cat e tag, ma sembra non funzionare niente.
Considerando le mie limitate capacità in php, volevo sapere se qualcuno è in grado di aiutarmi.Grazie mille sin da ora.
-
Non hai specificato l’indirizzo di un blog o la ragione del messaggio quando hai creato questo topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
-
-
Ciao, purtroppo questo forum tratta solo gli argomenti relativi a WordPress.com e non le installazioni del pacchetto WordPress su altri host.
I forum che ti possono essere d’aiuto sono questi:
http://www.wordpress-it.it/forum/
http://wordpress.org/support/Per quanto riguarda la differenza leggi qui:
https://it.forums.wordpress.com/topic/traduzione-wordpresscom-o-wordpressorg-la-differenza?replies=1
- L'argomento ‘Problemi con query_posts’ è chiuso a nuove risposte.