Home › Forum › Plugin e temi di WP › Motore di ricerca interno
-
AutorePost
-
-
30 Settembre 2008 alle 11:13 #8046spino974Partecipante
Ciao a tutti, dopo aver cercato sul forum, google, sulla guida wiki, non sono riuscito a trovare ciò che mi serviva, quindi in extremis provo a chiedere a voi.
Sono intento a costruire un sito di eventi, a tal fine, dopo numerose prove e ricerche tra i vari plugin ho installato wp-events, molto funzionale per il mio intento.
Il lato negativo, e qui torno all’argomento della discussione, è che vorrei inserire il widget cerca. Il problema a stò punto è che tale motore di ricerca, va ad analizzare le tabelle dove ci sono gli articoli, mentre invece a me servirebbe che vada a fare la ricerca all’inteno della tabella wp_events dove si trovano gli eventi di cui voglio ottenere i risultati della ricerca.
Spippolando un pò ho capito che dalla cartella del tema c’è il file searchform.php dove si trova la casella dove inserire la parola chiave da ricercare, quindi il lavoro di ricerca lo esegue il file wp-includes/query.php.
secondo me la parte da modificare è proprio in questo file e precisamente:
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
$searchand = ' AND ';
}
$term = $wpdb->escape($q);
if (!$q && count($q) > 1 && $q[0] != $q )
$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
ma in che modo? Mi potete dare una mano?
Grazie
-
30 Settembre 2008 alle 11:53 #58227wollyAmministratore del forum
personalmente ho eliminato il motore di ricerca interno perchè non è un granche e sul mio blog ho messo google che funziona molto bene.
-
30 Settembre 2008 alle 12:01 #58228spino974Partecipante
Però se il sito non è ancora indicizzato, da google, se uno fa una ricerca non ottiene nessun risultato. O sbaglio?
-
30 Settembre 2008 alle 12:07 #58229wollyAmministratore del forum
usa il plugin sitemap generator e google indicizza velocemente.
DI norma i miei post sono indicizzati dopo pochi minuti.
ciao
-
30 Settembre 2008 alle 12:12 #58230spino974Partecipante
uhm… ho capito… il fatto è che è diventata una sfida che vorrei vincere
Magari col vostro aiuto
Ciao e cmq grazie per le risposte
-
30 Settembre 2008 alle 12:18 #58231wollyAmministratore del forum
ti sconsiglio di modificare i files del core di wordpress è pratica pericolosa e poi ad ogni aggiornamento dovresti rifarlo.
-
30 Settembre 2008 alle 16:48 #58242ondapiPartecipante
se il sito non è ancora indicizzato
dagli un attimo di tempo…
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.