Risposte nei forum create
-
AutorePost
-
cammelloAfganoPartecipante
Per chi avesse questo stesso problema posto qui il link con la soluzione:
http://wordpress.org/support/topic/custom-query-only-displays-4-posts-rest-is-404?replies=3
cammelloAfganoPartecipanteCiao,
anche io ho riscontrato una cosa simile se non identica (qui), la custom query fà saltare l’impaginazione, molto probabilmente é un bug.
Se per caso trovi una soluzione al problema me lo fai sapere? Anche io farò la stessa cosa naturalmente!
cammelloAfganoPartecipanteCiao,
son tornato dalle ferie e speranzoso sono subito andato a leggere il topic che avevo creato, ma vedo che dopo il mio ultimo intervento non ci sono state risposte.
Devo pensare che il problema non sia di facile soluzione?
Desideravo solo sapere se sono stati effettivamente incontrati bugs con i navigation links relativi ad una custom query inserita ad inizio pagina o se solo io li ho riscontrati.
Ciao
Giovanni
cammelloAfganoPartecipanteSi Wolly,
ho appena provato mettendo il rewind_posts(); dopo end_while; (fine del loop have_posts()) e poi ho aggiunto un wp_reset_query(); prima del get_footer().
Il problema é proprio la custom query, perché se lascio quella di default (con posts_per_page settata da pannello di controllo nella sezione Lettura -> Le pagine del blog visualizzano al massimo: 6 posts), i nav links vanno perfettamente!
Ad esempio:
http://www.giovannigarzella.it/wordpress/category/video-dal-mondo/page/2 esiste, non mi rimanda alla 404.php.
Se commento la custom query, anche http://www.giovannigarzella.it/wordpress/category/eventi/page/2 dà dei giusti risultati… L’ho appena fatto e và , solo che io ho bisogno di inserire una custom query con post_status => ‘future’ per visualizzare solo gli eventi che devono ancora venire e poterli cosଠordinarli per data (quella del post programmato, stabilita direttamente dal pannello di controllo al momento della creazione dell’articolo).
cammelloAfganoPartecipanteOk Wolly,
però la struttura personalizzata /%postname%.html mi sembra quella più corretta.
Ho comunque salvato nuovamente i permalinks, ma il problema sussiste lo stesso.
Quello che vorrei capire é se qualcun altro ha avuto lo stesso problema, cioé se modificando una query con la struttura che hai scritto tu (query_posts array_merge) e inserendo i metodi prev_posts_link e next_posts_link, questi ultimi mostrano risultati corretti se passo alla pagina successiva (%postaname%.html/page2).
Capirei cosଠse effettivamente si tratta di un bug di wordpress, un metodo non usato che mi sfugge, un codice scritto male oppure l’intera struttura del sito che non và .
cammelloAfganoPartecipanteSe per permalinks invece intendi quelli creati da next_posts_link() e prev_posts_link() si, li ho messi dopo la query e prima del loop.
Ciao
cammelloAfganoPartecipanteWolly,
dici da pannello di controllo o da codice?
Io nel pannello di controllo ho questo settaggio: http://www.giovannigarzella.it/permalinks.jpg
cammelloAfganoPartecipanteGrazie Wolly,
ho provato subito la tua soluzione ma sembra non funzionare.
Prima del get_header() (poi hop provato pure a metterlo dopo), ho scritto:
global $wp_query;
query_posts(array_merge(
array(‘post_status’ => ‘future’, ‘posts_per_page’ => 2),
$wp_query->query
)
);
Niente.
poi ho provato una query più semplice:
global $wp_query;
query_posts(array_merge(
array(‘posts_per_page’ => 1),
$wp_query->query
)
);
Ma continua a non andare, visto che i post in questo caso sono due e quindi a pagina 2 mi dovrebbe far vedere il secondo post, invece mi và alla 404.php
-
AutorePost