Home › Forum › Amministrazione WP › Inserire articoli in altre pagine e inserirli nella homepage
-
AutorePost
-
-
29 Ottobre 2008 alle 12:45 #8343MurackPartecipante
salve
sto creando utilizzando wordpress un sito su altervista
ora vorrei alcuni chiarimenti su cosa posso fare, avendo io una certa idea su come strutturare il forum
io sostanzialmente vorrei creare un sito distribuito in pagine differenti, ognuna autonoma, aldilà della homepage, tipo:
Didattica —> una pagina dove riportare notizie di natura appunto didattica
Eventi —>pagina dove riportare date di eventi di vario tipo
Download —> pagina da dove poter scaricare file di vario tipo
Photogallery —> pagina dove inserire e quindi consultare vari tipi di album
tutte queste pagine vanno aggiornate con vari articoli, alcuni dei quali vorrei venissero elencati anche in home page, come articoli veri e propri…..
nn so se è chiaro ciò che vorrei fare io…..
cioè io vorrei poter scrivere articoli in altre pagine e decidere se riportare questi articoli nella homepage
ad esempio vorrei poter creare tipo categoria di articoli (tipo: didattica, eventi, etc) a cui però corripondano delle pagine
chiedo in anticipo scusa x la mia nubbiaggine in materia
-
29 Ottobre 2008 alle 19:35 #58955ondapiPartecipante
potresti creare più loop all’interno di un template di pagina che poi ti fa da home page
per le altre pagine, si vanno bene anche le pagine ma non hai provato a pensare a dei archivi per categoria
tipo per ugni evento crei un post in categoria eventi e poi anzichè richiamarli in una pagina li richiami per archivio tramite un link ?cat=2
-
30 Ottobre 2008 alle 9:47 #58960gollum1Partecipante
Secondo me il modo più semplice è crere un template di pagina per ogni pagina che vai a fare (o per lo meno, per ogni pagina di quelle che hai indicato) ogni template lo fai copiando index.php, e mettendo prima del loop il codice per filtrare le singole categorie.
quindi per esempio nella pagina news visualizzi solo gli articoli che posti nella categoria news.
visto che gli articoli possono avere più categorie, puoi modificare index.php per leggere gli articoli che fanno parte della sola categoria “home”, qwuindi in ogni momento puoi spostare un articolo nella pagina home semplicemente inserendolo nella categoria, e farlo sparire toglindocelo….
byez
—
Gollum1
-
30 Ottobre 2008 alle 14:11 #58978MurackPartecipante
grazie ad entrambi
credo che la soluzione di gollum sia quella che piu mi si addice
avrei però qualke domanda di natura tecnica, essendo io niubbo:
dove devo copiare index.php?
cosa è il loop?
quale codice devo inserire per filtrare le categorie?
scusa per tutte ste domanda
ti ringrazio in anticipo
-
30 Ottobre 2008 alle 16:21 #58981gollum1Partecipante
cerca sul wiki, template di pagina e l’articolo dissezione di un tema, che se anche non sono aggiornati all’ultima versione di WP, sono un’ottima partenza.
Byez
—
Gollum1
-
30 Ottobre 2008 alle 19:20 #58985ondapiPartecipante
quoto gollum
è un controsenso chiedere aiuto per qualcosa di cui non si conosce niente,
wiki+localhost sono una ottima officina, altrimenti qualsiasi consiglio sarà una impresa da gestire
lo svantaggio e che ci vuole un attimo di tempo, ma è l’unica via percorribile
allora si che il forum ti potrà essere veramente utile
a proposito appena hai compreso che cosè il loop vai a vederti il query_post permette bizzarre composizioni
ciao
-
30 Ottobre 2008 alle 20:07 #58988MurackPartecipante
grazie gollum
ho letto alcune pagine di quello che mi hai indicato
vorrei capire meglio
quando creo il nuovo template come spiegato al punto 9 di “Utilizzare le Pagine”, io nn faccio altro che creare un primo file php come nell’esempio indicato con questo codice:
<?php /* Template Name: Snarfer */ ?>
poi c aggiungo il codice del tema di cui faccio uso (copiandolo dall’index del tema che uso), giusto?
questo file lo devo salvare in una cartella con un suo nome all’interno di themes?
poi copio index.php del tema che uso e lo incollo in questa cartella del nuovo tema e lo modifico inserendo il codice per filtrare le categorie prima del loop
è giusto il procedimento?
una domanda: qual è questo codice da inserire prima del loop?
scusa per la mia nubbiaggine e per le eventuali cavolate che scrivo
io nn so niente di codice php…..ma nn esiste un plugin per fare tutta sta cosa in automatico?
se nn ti reco troppo disturbo, mi sa che ho bisogno di un assitenza passo dopo passo….
scusami ancora….
-
30 Ottobre 2008 alle 20:18 #58990gollum1Partecipante
1) per creare il template: sà¬, copi l’index.php del tuo tema e ci aggiungi quel commento in php che hai indicato.
2) no, non va inserito in una directory del tema, ma nella root del tema stesso… altrimenti non viene visto nell’editor.
3) se hai letto il messaggio di ondapi. ti ha dati l’input su cui devi lavorare:
cerca query_post nel wiki, o ancora meglio, in google la seguente stringa: site:codex.wordpress.org query_post
ti leggi attentamente i 5 risultati che ti appaiono e trovi anche un esempio di quello che vuoi fare.
byez
—
Gollum1
-
30 Ottobre 2008 alle 20:25 #58991MurackPartecipante
ok, vi ringrazio
scusate x la mia ignoranza
spero di riuscirci da solo
-
30 Ottobre 2008 alle 20:45 #58992MurackPartecipante
facendo una ricerca su google ho trovato questo articolo:
[LINK ELIMINATO PERCHE’ PROCEDURA ASSURDA]
credo che faccia al caso mio, vero?
-
30 Ottobre 2008 alle 21:14 #58993wollyAmministratore del forum
quell’articolo è solo un UCCS (ufficio complicazioni cose semplici)
Copia il file index.php e poi rinomina la copia in category-iddellacategoria.php
iddellacategoria lo vedi andando in gestione categorie e posizionandoci sopra il mouse e nella barra di stato in basso leggerai l’id.
Quel file poi lo carichi nella root del tuo tema ed il giochino è finito.
Se vuoi puoi personalizzare l’aspetto modificando i css
Puoi farlo per ogni categoria.
ciao
-
30 Ottobre 2008 alle 21:27 #58994MurackPartecipante
scusate se ho sbagliato ad inserire quel link
mi metterò sotto e cercherò di capire come fare
ringrazio ancora tutti e scusate per il disturbo
ciao
-
30 Ottobre 2008 alle 21:29 #58996wollyAmministratore del forum
murack fai quello che ho scritto in 1 minuto hai fatto tutto senza dover imparare nulla.
-
30 Ottobre 2008 alle 21:44 #58997MurackPartecipante
ok
lo so che nn è cosi che si dovrebbe procedere
mi piacerebbe imparare come funge tutto, però nn sono un webmaster e mi hanno affidato la costruzione di un sito solo xchè mi intendo un po di pc (ovviamente un ambito che ha poco a che fare con ste cose, ambito sicurezza)
in piu ho poco tempo……
cmq, grazie a tutti
ciao
-
31 Ottobre 2008 alle 12:24 #59007MurackPartecipante
ringrazio tutti
sono riuscito nel mio intento
sinceramente ho provato a usare la soluzione di wolly, ma la mia deficienza mi ha impedito probabilmente di mettere bene in pratica le sue indicazioni e nn c sono riuscito
allora ho provato le indicazioni presente in quell’articolo che è stato rimosso e c sono riuscito
grazie sopratutto a gollum per la pasienza (ovviamente grazie anche agli altri)
una volta che finirò il sito, metterò il vostro link per ringraziarvi
ciao
-
31 Ottobre 2008 alle 12:53 #59008wollyAmministratore del forum
murack :
1)prendere il file index.php del tuo tema
2)soprire ID della categoria (è un numero per esempio 1)
3)Rinominare il file index.php che hai copiato in category-1.php
4)Caricare il file cosଠnominato nella directory del tuo tema
Finito tutto.
-
31 Ottobre 2008 alle 12:57 #59009wollyAmministratore del forum
per escludere le categorie dal loop nel file index.php
!–here i exclude the category hidden–
?php if (in_category(‘2006’)) continue; ?
!–end here i exclude the category hidden–
mancano < e >
-
3 Novembre 2008 alle 12:13 #59061MurackPartecipante
mi ricollego a qui per una domanda simile, forse collegato a questa ultima indicazione di wolly, che ringrazio
io vorrei scrivere una serie di articoli che però appaiano solo su una diversa pagina/e
cioè, riportando quanto scritto sopra, vorrei scrivere solo articoli in Didattica
quindi articolo categoria Didattica —> da visualizzare solo nella pagina Didattica
e anche
articolo categoria download —> da visualizzare solo nella pagine Download
grazie in anticipo
ciau
-
3 Novembre 2008 alle 12:49 #59062wollyAmministratore del forum
fai quello che ho scritto appena prima
-
3 Novembre 2008 alle 18:41 #59084MurackPartecipante
grazie wolly, l’avevo intuito
piccola domandina: il numero della categoria va inserito tra parentesi, al posto del 2006 nell’esempio da te indicato?
grazie x tutto
ciao
-
3 Novembre 2008 alle 18:43 #59085MurackPartecipante
ah una cosa: cosi vuol dire la parte finale del tuo post,ovvero
mancano < e >
thanks
-
3 Novembre 2008 alle 18:55 #59087wollyAmministratore del forum
che devi completare il codice che ho messo con l’apertura e chiusura che altrimenti il forum non pubblicava il codice.
-
3 Novembre 2008 alle 22:57 #59095MurackPartecipante
ehm…..scusa se ti rompo le scatole nuovamente, però vorrei capire dove inserirlo questo codice
lo devo inserire nel file index.php presente nella root del mio tema,giusto?
e dove di preciso?
dovrebbe essere cosi?
< e >
!–here i exclude the category hidden–
?php if (in_category(‘6’)) continue; ?
!–end here i exclude the category hidden–
< / e >
dove 6 è l’ id della categoria da escludere
nel caso di piu categorie? suddivido i numeri da una virgola?
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.