Home › Forum › Problemi Vari con WP › un layout diverso per il blog
-
AutorePost
-
-
28 Gennaio 2009 alle 14:16 #9252elo-artPartecipante
Salve, mi sono appena iscritta al vostro forum per cercare di risolvere questo problema che mi si è posto ultimamente.
Per il mio lavoro, necessito di avere un portfolio online e uso wordpress dal 2006 e mi ci sono sempre trovata benissimo. Ho già , in precedenza, spostato il blog in un altra pagina e impostato un’altra home.
Ma al momento sto creato un nuovo layout per il mio sito che è valido x tutte le pagine (con photoshop), ma avrei bisogno di diversificare quella del BLOG (con lo stesso layout delle altre pagine ma con particolari diversi che ho creato appositamente per quella sezione).
Ho letto alcune guide sul vostro sito in proposito ai template…ma ho come la sensazione che non sia quello che serve nel mio caso. In quanto non devo creare nuove pagine o dare impostazioni diverse al mio tema (che deve rimanere invariato) ma far si che nella pagina del mio blog vengano caricate le immagini del layout…
la mia logica mi suggerisce che servirebbe un altro foglio di stile solo x la pagina del blog…ma considerando che la mia logica è del tutto inaffidabile in materia..mi rivolgo a voi…
*perplimo*
spero di essere stata abbastanza chiara nell’esposizione del mio problema
elo
-
28 Gennaio 2009 alle 15:51 #61887SteveAglAmministratore del forum
Non ho ben capito cosa vuoi fare e se quando parli di sito intendi cose esterne a WP e con blog la parte di WP, per WP devi creare un tema che sia identico al resto del sito, eventualmente usando template diversi per pagine oppure se le condizioni per mostrare una cosa o l’altra sono diverse usando i tag condizionali nei file di template per ad esempio identificare un elemnto con una classe diversa a seconda che sia la pagina indici o una pagina di un singolo articolo.
Dettagliare un esempio aiuterebbe a capire.
-
28 Gennaio 2009 alle 16:20 #61894elo-artPartecipante
Non ho ben capito cosa vuoi fare e se quando parli di sito intendi cose esterne a WP e con blog la parte di WP, per WP devi creare un tema che sia identico al resto del sito, eventualmente usando template diversi per pagine oppure se le condizioni per mostrare una cosa o l’altra sono diverse usando i tag condizionali nei file di template per ad esempio identificare un elemnto con una classe diversa a seconda che sia la pagina indici o una pagina di un singolo articolo.
Dettagliare un esempio aiuterebbe a capire.
vediamo se cosଠsi capisce meglio ;
layout del sito + tema diverso per blog
la grandezza della tabella del layout del blog sarà uguale a quella delle altre pagine (anke se sull’immagine non si vede).
edit:
si quando parlo di sito mi riferisco sempre alla piattaforma di wordpress. tutte le pagine del mio WP hanno lo stesso lo stesso tema ke è il primo nell’immagine ke ho postato. e x l’impostazione della pagina del blog ke vorrei mettere la seconda tabella ke vedi nella jpg; che cmq maniente le stesse caratteristiche delle altre pagine a parte qlke elemento. Cosଠper diversificarla dalle altre.
Cmq parlo sempre di pagine e non di articoli, xkè la visualizzazione del blog l’ho spostata in un altra pagina e su quella pagina ke vorrei ke ci fosse un altro tipo di layout (vedere figura 2 dell’immagine). Ho tentato di capire come funzionavano i template per poter modificare la cosa seguendo le vostre guide, ma non sono riuscita a venire a capo di nulla °_°
xkè un avolta creato un template nuovo per customizzarlo per la causa, non so in quale codice inserire in php per richiamare la stessa struttura che c’è nel foglio di stile, da dove io di solito modifico l’aspetto di tutto WP.
tenendo conto che quelle tabelle tabella che vedi sono divise in parti che io carico sostituendo lo sfondo della testata e un altra parte quella del corpo della pagina.
-
28 Gennaio 2009 alle 16:41 #61895SteveAglAmministratore del forum
Quindi hai il sito con pagine WP usando page.php o template personalizzati di pagina il blog che usa la la index.php/cetegory.php/single.php(archives.php per il blog giusto?
(non si vede nessuna immagine nel tuo post)
Quindi se è cosଠe devi caricare un scc diverso usi i tag condizionali nell’header (http://codex.wordpress.org/Conditional_Tags) per caricare un diverso CSS che di aspetto diverso al tutto… oppure usi sempre i tag condizionali per definire una classe differente per l’elemento che contiene il blog (es. una div id=content) che poi verrà “caratterizzata con delle classi (blog e site ad es) che avranno opzioni diverse nel CSS in tal modo hai solo un file CSS.
Fra le due soluzioni io preferirei la prima perchè con un solo if verifico tutto mentre la seconda potrebbe prevedere molti if sparsi nei template.
-
28 Gennaio 2009 alle 17:01 #61897elo-artPartecipante
quindi, vediamo se ho capito bene:
dovrei creare attraverso questi tag condizionale 2 diversi file CSS di stile?
(scc? non so cos’è, o intendevi css?)
e in quel link ke mi hai messo c’è anche scritto come collegare quel nuovo foglio di stile alla pagina che desidero? considerando che quello di base è valido per tutto WP, in teoria dovrei fare si che il secondo foglio di stile che vado a creare sia poi collegato da uno script ke dice ke deve essere utilizzato in quella pagina specifica. e questo lo faccio con questi tag condizionali? ( i collegamenti diko).
quindi potrei creare un doppio del foglio di stile ke ho cambiandone il nome e aggiungendo le giuste tag? °_°
guarda ti diko, io del tema che sto utilizzando (e modificando) non ho nessun file single.php e neanche archiveS.php
ho solo:
style.css
e poi i php:
comments.php
footer.php
functions.php
header.php
index.php
page.php
search.php
sidebar.php
archive.php
*ri-perplimo*
vedi se cosଠfunziona —-> qua
-
28 Gennaio 2009 alle 17:19 #61898SteveAglAmministratore del forum
Se intendi che su quella pagina trovi esattamente le righe di codice per avere due css la risposta è no… ma ci sono altri esempi e alla fine capito come funzionano i tag condizionali far uscire una data, una frase o un link ad un css è la stessa cosa.
Se non hai single.php e archives.php WP usa sempre index.php, sul nostro viki la gerarchia dei template chiarirà cosa usa WP e quando e cosa usa in sostituzione se manca un file (non obbligatorio)
-
28 Gennaio 2009 alle 17:32 #61899elo-artPartecipante
mmmhm…ok vedo di copirci qualcosa con queste tag e rompo il vetro in caso di emergenza con un grido se mi trovo in difficoltà :°D
grazie per la disponibilità e la gentilezza!
elo
-
2 Febbraio 2009 alle 11:14 #62069
-
2 Febbraio 2009 alle 15:58 #62080essezetaPartecipante
ciao…
mi riallaccio a quanto ti avevo scritto in privato e lo rendo pubblico qui sul forum in modo che altri possa contribuire…
d’ora in poi continuiamo qui… e facciamo riferimento ai vari punti:
Dunque, per quello che chiedi io farei cosଠ(eviti i commenti condizionali e mantinei un unico file css):
1.
nella cartella del tema apri il file page.php e in cima a tutto il codice ci metti queste 5 righe
<?php
/*
Template Name: PAGINAPERSONALIZZATA
*/
?>
2.
Poi lo salvi con nome, ad es. paginapersonalizzata.php
3.
Da questo momento se crei una pagina statica (che intitolerai ad esempio “homepage”) tra gli attributi puoi scegliere il template e nel menu a discesa trovi TEMPLATE STANDARD e anche PAGINAPERSONALIZZATA…
4.
Tu scegli PAGINAPERSONALIZZATA…
5.
Poi setterai come pagina di apertura del tuo sito (ovvero in IMPOSTAZIONI / LETTURA / PAGINA INIZIALE ) la pagina “homepage” e scrivendo http://www.tuosito.com andrai a visitare automaticamente la pagina intitolata “homepage”…
6.
Quindi nel file “paginapersonalizzata.php” tu puoi reimpostare una struttura e delle classi ai vari elementi del markup e nel css ti personalizzi le immagini di sfondo…
Cerco di spiegarti come (perché mi sembra di aver capito che era qui che non sapevi come continuare):
6.1.
Il tuo file paginapersonalizzata.php apparirà più o meno cosଅ(in MAIUSCOLO qualche nota):
<?php
/*
Template Name: PAGINAPERSONALIZZATA
*/
?>
<?php get_header(); ?> QUAESTO INCLUDERA’ LA SEZIONE <HEAD> DOVE VIENE LINKATO IL TUO CSS
<div id=”container”> APRE IL CONTENITORE GENERALE
<div id=”colonnacentro”> APRE LA COLONNA CENTRALE
<div class=”posts”> APRE IL BOX DEI POST
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> PARTE IL CICLO
<h3><?php the_time(‘F jS, Y’) ?><!– by <?php the_author() ?> –></h3> INSERISCE DATA E AUTORE DEL POST O PAGINA
<h2><?php the_title(); ?></h2> INSERISCE TITOLO DEL POST O PAGINA
Reimposti i contenitori che mostrano immagini… e poi modifichi il tuo css…
Ho visto che tu hai immagini solo nell’header, nel container e nel footer… non è difficile…
Rileggendomi mi rendo conto che se uno non è troppo pratico di html+css+funzioni-di-wp rischia di sballare tutto…
se non capisci cosa fare posta il codice del tuo file page.php (il css l’hai già postato) e si fa prima…
ciao
-
2 Febbraio 2009 alle 16:52 #62083elo-artPartecipante
Grazie ancora per la tua disponibilità (e pazienza).
Dunque, la struttura della nuova pagina è abbastanza chiara.
a parte per le prime 3 voci, vediamo se inizio a capire qualcosa:
<?php get_header(); ?> è il codice che comunica con il mio css di base
<div id=”container”> dopo questo codice dovrei inserire le nuove immagini per la pagina personalizzata
<div id=”colonnacentro”> questo non ho ben capito a quale parte fa riferimento; a quella dove appariranno i post del blog?
per il punto 5: io in precedenza ho già impostato una pagina statica come “homepage” nel mio sito. in questo caso questo punto dovrei non considerarlo?
già , infatti non sono molto pratica del linguaggio informatico e per me niente è ovvio o sottointeso :°°) chiedo scusa quindi, se posso sembrare ripetitiva…a pensarlo non immaginavo fosse difficile, poi all’atto pratico lo è stato più del previsto.
cmq per non tralasciare niente metto il mio page.php
-
2 Febbraio 2009 alle 17:10 #62084willywonkaPartecipante
Scusate l’inserimento, ho un problema simile ma probabilmente molto più semplice:
Vorrei che una determinata pagine avesse un’immagine diversa nella testata e un colore diverso per sfondo e link (tutte cose che cambierei nel file style.css…).
Ho provato a seguire la procedura di cui parlate qui sopra ma forse sto solo complicando…
mi basterebbe poter associare a quella unica pagina un foglio di stile diverso.
Ho cercato nel forum ma non ho trovato il mio caso, c’è una parte wiki che posso consultare?
Grazie
W.W.
-
2 Febbraio 2009 alle 17:43 #62086essezetaPartecipante
in risposta a willywonka
se conosci già la pagina per cui vuoi impostare un css diverso fai cosଠ(che è poi il primo dei consigli dato da SteveAgl che parlava di condizionare…)
nel file header.php alla riga in cui viene incluso il css metti
<?php
if (is_home()) {
echo"<link rel="stylesheet" type="text/css" href="path_del_tema/special_style.css" />";
} else {
echo"<link rel="stylesheet" type="text/css" href="path_del_tema/normal_style.css" />";
}
?>
In partica cosଠtu imposti una condizione -che si tratti dell'home page- e allora in tal caso otterrai il css special_style.css in cui imposti le regole che ti pare... in tutti gli altri casi otterrai normal_style.css con gli styli normali...
Naturalmente se non ti trovi nell'home page ma in un'altra pagina devi cambiare la condizione (puoi anche im,postare l'ID di una singola pagina o di tutta una categoria, ecc.) e trovi tutti i rierimenti qui:
-
2 Febbraio 2009 alle 17:54 #62087essezetaPartecipante
in risposta a elo-art:
vedo che sei un po’ a secco di nozioni… non te la prendere… lo sono stato anche io… studia un po’ e ti rifarai…
colonnacentro era solo un esempio…
il file .php che hai linkato non può aprirlo nessuno…
ad ogni modo per darti un consiglio operativo e semplice:
per il punto 5: io in precedenza ho già impostato una pagina statica come “homepage” nel mio sito. in questo caso questo punto dovrei non considerarlo?
dal momento che hai già impostato una home page puoi usare lo stesso metodo indicato a willywonka (proprio quello con la condizione is_home(), ma devi personalizzare path_del_tema con il percorso al tuo tema…
mmmh… forse è meglio se ti posto tutto…
apri header.php, cerca una riga più o meno cosà¬:
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘stylesheet_url’); ?>” media=”screen,print” />
e sostituiscila con queste righe copiandole integralmente:
<?php
if (is_home()) {
echo"<link rel="stylesheet" type="text/css" href="http://www.eloelo.it/wp-content/themes/coronado/style_due.css" />";
} else {
echo"<link rel="stylesheet" type="text/css" href="http://www.eloelo.it/wp-content/themes/coronado/style.css" />";
}
?>
in questo modo in style_due.css puoi impostare l'aspetto della tua homepage...
ciao...
-
2 Febbraio 2009 alle 19:20 #62093elo-artPartecipante
funziona!
meno male, non sai che gioia, dopo tutti questi giorni di confusione! grazie mille mille mila! ^^
rimedierò in questo periodo x studiare meglio css e php. sei stato genitilissimo
grazie infinite ancora! ^^
elo
-
3 Febbraio 2009 alle 13:16 #62141willywonkaPartecipante
Sଠin effetti mi ero persa sulla storia del condizionare… il problema è che aprendo header.php con textedit (lavoro su Mac, non ho Dreamweaver) non riesco a visualizzare il codice, ma solo la scritta “Main Menu” e un link “home”… come potrei fare a vedere il codice per fare la modifica di cui mi parli?
Grazie ancora
W
Ferma tutto! Ho risolto! Funziona!
(ho scaricato Smultron: gratis, leggero, e colora il codice)
Grazie per gli ottimi consigli e soluzioni.
W
-
3 Febbraio 2009 alle 13:18 #62142SteveAglAmministratore del forum
Usare un banale editor di testo…
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.