Home › Forum › Problemi Vari con WP › aggiunta di una nuova sidebar
-
AutorePost
-
-
20 Aprile 2015 alle 17:46 #29389no_stressPartecipante
Salve ragazzi
vi scrivo in quanto avrei necessità di creare una nuova sidebar che prenda tutta la larghezza del container principale.
Ho modificato il file function.php aggiungendo il codice:
register_sidebar(array(‘name’=>’Sotto Header’));
In questo modo, andando in aspetto -> widget, mi ritrovo la sidebar chiamata “sotto header”
Ora so come popolarla, il problema e’ capire come mostrarla dove dico io.
Magari è una cavolata ma e’ la prima volta che lo faccio.
Sapete dirmi cosa devo aggiungere?
Inoltre, questa modifica dovrei averla solo nelle pagine degli articoli o delle pagine, non voglio averla in home page, magari da qui dipende anche la scelta del file da modificare?
Grazie
-
20 Aprile 2015 alle 19:53 #117043wollyAmministratore del forum
con questo: https://codex.wordpress.org/Conditional_Tags
e con get_sidebar(‘sotto-header’);
(ho modificato il nome della sidebar)
-
21 Aprile 2015 alle 17:48 #117056no_stressPartecipante
ciao wolly
allora, non ho usato quello che mi hai proposto perche’ ho visto dopo la tua risposta, ma in pratica dopo aver creato la sidebar, ho aggiunto questo codice alla pagina page.php
<div id="sotto_header">
<?php
if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sotto Header')): else : ?>
<?php endif; ?>
<div id="breadcrumbs">
<?php
if ( function_exists( 'breadcrumb_trail' ) ) breadcrumb_trail();
?>
</div>
</div>
In teoria dovrei visualizzare un’immagine a sinistra del layout ed i breadcrumbs a destra (tipo un header dove visualizza il logo a sinistra ed un eventuale banner a destra)
Il problema e’ che i contenuti dei 2 div non sono allineati ma sono uno sotto l’altro.
Da cosa puo’ dipendere?
-
21 Aprile 2015 alle 20:22 #117057elmaniseroPartecipante
CSS (Cascading Style Sheets, in italiano fogli di stile) e nel caso non sapessi come fare e ti accingessi a chiedere un aiuto rivolgiti ad un forum dedicato al CSS come questo.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.