Home › Forum › Problemi Vari con WP › Problema con la ricerca se effettuata dopo aver aperto un risultato
-
AutorePost
-
-
3 Marzo 2011 alle 23:21 #16989kokkolosPartecipante
Ciao a tutti!
Il mio sito è http://www.melarumors.com potete notare voi stessi che :
1) dalla homepage effettuo la ricerca, tutto funziona correttamente
2) quando appaiono i risultati, NON CLICCO su nessun risultato e faccio un’altra ricerca…ancora tutto ok
3) se apro un risultato della ricerca e provo a fare un’altra ricerca con altre query la famosa voce “?s=query” viene messa dopo il nome del link aperto.
Es:
Cerco “iPad 2” l’url è http://www.melarumors.com/?s=ipad+2 apro un risultato http://www.melarumors.com/imovie-per-ipad-2-ottima-app/ , effettuo un’altra ricerca (macbook) dalla pagina e l’url diventa http://www.melarumors.com/imovie-per-ipad-2-ottima-app/?s=macbook
Ovviamente mi genera un errore di percorso non trovato.
Come posso risolvere secondo voi?
Vi ringrazio.
Saluti
-
4 Marzo 2011 alle 6:49 #81848SteveAglAmministratore del forum
perchè l’action del form di ricerca è vuota e quindi i dati vengono passati alla url corrente una banale modifica in:
action=”<?php echo home_url( ‘/’ );?>”
risolve il rpoblema.
-
4 Marzo 2011 alle 14:28 #81889kokkolosPartecipante
Ecco il mio codice … dove cambio questa voce?
<?php get_header(); ?>
<!– begin colLeft –>
<div id=”colLeft” class=”clearfix”>
<div class=”searchQuery”>Risultati di ricerca per <?php /* Search Count */ $allsearch = &new WP_Query(“s=$s&showposts=-1″); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(”); _e(‘‘); echo $key; _e(‘‘); wp_reset_query(); ?></div>
<?php if (have_posts()) : while (have_posts()) : the_post();
?>
<!– begin post –>
<div class=”blogPost clearfix”>
<div class=”metaLeft”>
<div class=”month”><?php the_time(‘F’) ?></div>
<div class=”day”><?php the_time(‘j’) ?></div>
<div class=”comments”><?php comments_popup_link(‘0’, ‘1’, ‘%’); ?></div>
</div>
<div class=”postRight”>
<div class=”titBullet”></div>
<h1>“><?php the_title(); ?></h1>
<div class=”metaRight”>
/images/ico_user.png” alt=”Author” /> <?php the_author_link(); ?> /images/ico_folder.png” alt=”Category” /> <?php the_category(‘, ‘) ?> /images/ico_tag.png” alt=”Tags” /> <?php the_tags(‘ ‘, ‘, ‘, ”); ?></div>
<?php the_excerpt(); ?>
</div>
</div>
<!– end post –>
<?php endwhile; ?>
<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(‘Vecchi articoli’) ?></div>
<div class=”alignright”><?php previous_posts_link(‘Nuovi articoli’) ?></div>
</div>
<?php else : ?>
<p>Spiacenti, ma la tua ricerca non ha prodotto risultati!</p>
<?php endif; ?>
</div>
<!– end colLeft –>
<!– begin colRight –>
<div id=”colRight” class=”clearfix”>
<?php get_sidebar(); ?>
</div>
<!– end colRight –>
<?php get_footer(); ?>
-
4 Marzo 2011 alle 14:57 #81892SteveAglAmministratore del forum
Do ve hai il form di reicerca che qua non vedo ergo forse nell’header.php… basta cercarlo.. su un po’ di buona volontà
-
4 Marzo 2011 alle 15:35 #81894kokkolosPartecipante
Ma perchè siete cosଠ“freddi”? Se volete aiutare, aiutate senza “incoraggiamenti vari”…se ho chiesto aiuto nel forum è perchè non so dove mettere mani! Se tu avessi specificato meglio dove fare la modifica, probabilmente non ci sarebbe stata la mia seconda domanda! GRAZIE!!!
-
4 Marzo 2011 alle 15:37 #81895wollyAmministratore del forum
perchè secondo te noi consociamo come sono fatti tutti i mille mila temi che sistono? Sapiamo il codice che viene utilizzato e dove viene messo e magari anche la riga esatta e il file?
-
4 Marzo 2011 alle 15:52 #81900SteveAglAmministratore del forum
il file che hai postato non ha il codice.. non so che tema usi e anche se lo sapessi non posso mica scaricarmelo e studiarmelo… ti ho detto che dove c’è il form della ricerca c0è un errore, passi i vari file del tuo tema e cerchi il form della ricerca… se sta in alto spesso è in header.php… di più dimmi che cosa vuoi che accedo via ftp al tuo sito e lo sistemo? Io ste cose le faccio.. ma non per il forum e non gratis. Qui diamo supporto NON soluzioni fatte e pronte… se non sono di poche righe
-
4 Marzo 2011 alle 16:22 #81903kokkolosPartecipante
Hai perfettamente ragione, avrei gradito maggiore “gentilezza”.
Comunque la stringa che mi hai indicato non è presente in alcuna parte del tema…neanche le parole “home_url” o “action”…
Sapresti indicarmi altre soluzioni?
-
4 Marzo 2011 alle 16:29 #81904SteveAglAmministratore del forum
allora questa:
get_search_form()
stampa il form di ricerca standard.. ma siccome quello standard ha la url corretta generata da WP non credo sia quello… devi avere una forma da qualche parte
-
4 Marzo 2011 alle 16:43 #81907kokkolosPartecipante
Ecco la parte di codice dovrebbe essere questa
<div id=”searchBox” class=”clearfix”>
<form id=”searchform” action=”” method=”get”>
<input id=”s” type=”text” name=”s” value=””/>
<input id=”searchsubmit” type=”submit” value=”CERCA”/>
</form>
</div>
-
4 Marzo 2011 alle 16:51 #81908SteveAglAmministratore del forum
ed io ho scritto:
perchè l’action del form di ricerca è vuota e quindi i dati vengono passati alla url corrente una banale modifica in:
action=”<?php echo home_url( ‘/’ );?>”
risolve il rpoblema.
direi che sai dove mettere le mani ora o no?
-
4 Marzo 2011 alle 16:53 #81909kokkolosPartecipante
certo, ma sparisce l’intera sidebar e footer! perchè la stringa che ti ho inviato è presente in sidebar.php!
ti ringrazio se puoi compilare direttamente quella porzione di codice cosଠti dico se è identica a quella che ho fatto io che mi ha fatto sparire la sidebar e il footer..
-
4 Marzo 2011 alle 17:03 #81911kokkolosPartecipante
risolto! grazie 1000 non avevo chiuso con > …
grazie ancora!
-
4 Marzo 2011 alle 17:04 #81912SteveAglAmministratore del forum
<form id=”searchform” action=”” method=”get”>
diventa
<form id=”searchform” action=”<?php echo home_url( ‘/’ );?>” method=”get”>
-
4 Marzo 2011 alle 17:05 #81913SteveAglAmministratore del forum
Domanda ma chi ha fatto quel tema in quel modo?
-
4 Marzo 2011 alle 21:37 #81953kokkolosPartecipante
perchè? …
-
5 Marzo 2011 alle 7:44 #81962SteveAglAmministratore del forum
Vabbè rinuncio… ma ti rispondo lo stesso: perchè se uno fa un tema per WP e poi mette un form di ricerca in quel modo significa che non capisce nulla di WP.. se lo ha fatto gratis si può perdonare se si è fatto pagare no!
Nell’header ci son porcate come detto da zenhia etc etc… insomma ero solo cuiroso.. ma se devo perdere 4 domaned e risposte ogni volta rinuncio… a tutto.. arrivederci.
-
5 Marzo 2011 alle 16:19 #81974kokkolosPartecipante
Ciao! Comunque ho modificato personalmente, con le mie povere conoscenze, un tema già esistente! Quali sarebbero le porcate?
-
5 Marzo 2011 alle 16:22 #81975SteveAglAmministratore del forum
quel form ad esempio… gli header dell’altro thread.. altro non so non i son messo a farne il debug… per un lavoro gratuito.. è perdonabile…
PS: il tema originale aveva dei credits? perchè li non ne vedo pare un tema creato ad hoc visto anche il nome
PPS: Ah.. mi scordavo.. prego!!
-
5 Marzo 2011 alle 16:29 #81976kokkolosPartecipante
Comunque ho sfruttato solo il css di un tema…cambiandolo…il resto è stato tutto assemblato da me alla meno peggio! Vabbè, grazie comunque per il tempo dedicato e scusa se ho tolto troppo tempo!
Un saluto vi ringrazio
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.