Home › Forum › Problemi Vari con WP › destinazione articoli
-
AutorePost
-
-
22 Aprile 2010 alle 22:42 #13688francyPartecipante
Ciao a tutti ho un problema, provo a spiegarmi: vorrei pubblicare un articolo sulla prima pagina e fino a qui tutto ok, ma se io voglio decidere in che pagina pubblicare l’articolo senza farlo vedere nella pagina principale ma solo nella pagina che ho scelto e quindi l’articolo diviene visibile solo se si accede alla pagina, come posso fare? io ogni volta modifico la pagina direttamente, ma cosଠperdo l’articolo e non è comodo
grazie
-
23 Aprile 2010 alle 8:32 #72939EliasPartecipante
Devi lavorare sulle categorie, assegnare ad ogni post una categoria, poi in home deciti solo quelle da visualizzare e cosଠanche nelle altre pagine.
Questo è il codice da inserire nel loop per visualizzare delle categorie specifiche:
<?php query_posts('cat=x'); ?>
dove x è il numero della categoria che vuoi visualizzare.
-
23 Aprile 2010 alle 12:49 #72943francyPartecipante
In pratica dovrei dare al nome della pagina lo stesso della categoria? pero poi come faccio ogni volta che aggiungo un articolo nuovo a non farlo vedere nella prima pagina puoi spiegarmi meglio grazie e scusa la stupidità
-
24 Aprile 2010 alle 13:59 #72968loopPartecipante
Il modo più semplice per ottenere questo risultato è quello di creare una categoria che conterrà tutti i post che vorrai nascondere in home. In questo modo ti basta modificare l’index.php del tuo tema escludendo tale categoria dal loop di wordpress come ti suggeriva Elias con <?php query_posts(‘cat=ID’); ?> con ID si intende l’ID della categoria. E in questo modo i post non saranno visibili in home ma saranno visibili nella pagina di categoria, cosଠnon dovrai creare pagine aggiuntive ma sfrutti le funzioni di wp.
-
25 Aprile 2010 alle 9:40 #73003francyPartecipante
ko grazie peccato che non ho capito molto nella pratica come devo fare ti chiedo di avere pazienza
il link è questo: http://www.marketingpub.netsons.org/ come vedi vorrei mettere gli articoli che voglio nella home e altri che decido sempre io nella pagina dish of the day. puoi farmi dei passi grazie mille di nuovo
-
25 Aprile 2010 alle 10:48 #73005loopPartecipante
Crei una categoria che si chiamerà dish of the day nella quale inserirai i suddetti post. Poi inserisci nel file index.php prima del loop <?php query_posts(‘cat=ID’); ?> con ID si intende l’ID della categoria in maniera tale che quella categoria venga esclusa del loop di wordpress. Poi per vedere i post ti basterà andare alla pagina http://www.dominio.tld/category/dishoftheday e cosଠvedi quello che hai scritto.
-
25 Aprile 2010 alle 13:37 #73009francyPartecipante
ma cosଠfacendo ottengo un risultato diverso io vorrei alcuni articoli sulla home e altri sulla pagina piatti del giorno, visualizzabili solo se uno ci entra…….. ti capisco sono di coccio ma non mi è chiaro
-
25 Aprile 2010 alle 14:06 #73010loopPartecipante
Se crei la categoria “piatti del giorno” e ci scrivi gli articoli, e quella categoria la escludi dal loop di wordpress in homepage, otterai che:
in homepage vedrai tutti gli articoli (cioè tutte le altre categorie) ESCLUSA la categoria piatti del giorno, invece andando al link http://www.dominio.tld/category/dishoftheday vedrai SOLO gli articoli contenuti nella categoria piatti del giorno ESCLUSI tutti gli altri.
Meglio adesso? Più semplice di cosଠnon riesco a spiegarmi, credo sia quello che cerchi tu, oppure non ho capito nulla io
-
25 Aprile 2010 alle 14:51 #73011francyPartecipante
ok grazie della pazienza pero in questo modo io vedrei gli articoli piatti del giorno solo se entro nella categoria io invece vorrei vederli nella pagina piatti del giorno dal momento in cui ci entro http://www.dominio.tld/dishoftheday, dovrebbe essere questo l’ipotetico il link o sbaglio?
-
25 Aprile 2010 alle 16:02 #73012loopPartecipante
Quella che ti ho suggerito è la soluzione più semplice che mi venga in mente, che ti permette di ottenere il risultato mettendo mano al code solo una volta e aggiungendo solo una semplice stringa. Tra averli in una pagina e averli nella pagina categoria non vedo cosa cambi, solo il link. Oppure se è una questione di layout puoi sempre creare un layout ad hoc creando un file category-ID.php e personalizzandolo.
In alternativa se proprio non ti piace l’idea non resta che crearti un bella pagina template di wordpress, richiamando tramite query il loop e la categoria, e di conseguenza ti gestisci tutto come preferisci, layout etc etc…
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.