Home › Forum › Plugin e temi di WP › togliere campo di ricerca dalla sidebar
-
AutorePost
-
-
8 Dicembre 2010 alle 8:13 #15942peppe01Partecipante
Allora,
il wp è la 3.02, il tema twentyten.
Quello che voglio fare è spostare il campo search dalla sidebar alla header, possibilmente nella navbar, barra di navigazione orizzontale.
Quello che faccio è cancellare da sidebar.php il codice che individuo e lo incollo nel file header.php, il codice è
<div id=”search” class=”widget-container widget_search”>
<?php get_search_form(); ?>
</div>
Quello che succede è che ho due campi di ricerca, nella sidebar e nella navbar della header.
Penso a qualche manifestazione dell’override override, io tolgo una cosa, ma vien fuori una che sta sotto. Sinceramente da ieri navigo tra i file di wp,
ma non riesco a togliere il campo di ricerca dalla sidebar.
Qualcuno sa cosa devo fare?
Grazie
-
8 Dicembre 2010 alle 9:22 #79386gardawebPartecipante
non ne sono pienamente convinto, ma secondo me nn devi riportare/incollare anche il div nell’header, ma devi usare o creare un nuovo div apposito per l’header.
Io farei in questo modo nella sidebar:
<!– <div id=”search” class=”widget-container widget_search”>
<?php get_search_form(); ?>
</div> –>
e nell’header inserirei:
<div id=”search” class=”mia-classe-header”>
<?php get_search_form(); ?>
</div>
naturalmente ci sarà da lavorare sul css per adattarlo al menu che hai…
Ciao
-
8 Dicembre 2010 alle 9:49 #79388peppe01Partecipante
Ciao, grazie per la risposta, di fatto già avevo provato commentando invece di cancellare nella sidebar.php e cambiando classe css nell’header.php, ma nulla da fare, è come se da qualche altra parte è scritto che nella vecchia sidebar deve comparire la maledetta search, dico in altrifile sparsi in wp.
Scusate ma di fatto sono quasi nuovo di wp, e ancora non ho capito i criteri generali.
Per esempio leggo una riga prima delle righe che ho inserito in header.php:
<?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>
<div id=”search” class=”mia-classe-header”>
<?php get_search_form(); ?>
</div>
intuisco, dalla terminologia intuitiva, che la navbar prende informazioni altrove sul suo posizionamento nel layout, ma sul search non trovo nulla del genere.
Trovo pure un file sidebar.php fuori dal template nella cartella wp-content/wp-includes/theme-compact/, per questo ho pensato che fosse un problema di override, ma tolto il search da questo secondo file continuano a comparire due search.php
Grazie comunque per il suggerimento
-
8 Dicembre 2010 alle 9:50 #79389wollyAmministratore del forum
non è che è un widget?
-
8 Dicembre 2010 alle 10:06 #79390peppe01Partecipante
Come posso scoprirlo/modifiarlo?
-
8 Dicembre 2010 alle 10:08 #79391peppe01Partecipante
Ok risolto dall’area widget dell’area amministrazione, GRAZIE!
-
8 Dicembre 2010 alle 10:23 #79392peppe01Partecipante
Comunque fantastici i vecchi widget, ho semplicemente incollato il codice
// A second sidebar for widgets, just because.
if ( is_active_sidebar( ‘secondary-widget-area’ ) ) : ?>
<div id=”secondary” class=”widget-area” role=”complementary”>
<ul class=”xoxo”>
<?php dynamic_sidebar( ‘secondary-widget-area’ ); ?>
</div><!– #secondary .widget-area –>
<?php endif; ?>
e poi ho messo il widget search dall’amministrazione nell’area widget secondaria e tutto funziona benissimo!!!!
Dove posso trovare documentazione più approfondita sui widget?
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.