Home › Forum › Problemi Vari con WP › Articoli in una pagina ma solo come “riassunto” – Non va…
-
AutorePost
-
-
26 Novembre 2010 alle 11:42 #15776Robby79Partecipante
Ragazzi non riesco a fare una cosa…(ho visto e provato di tutto sul forum ma nulla…)
Da una pagina riesco a far visualizzare gli articoli ma li vorrei solo in testo e non completi….
Non riesco a far vedere solo gli articoli, come faccio?
Ho provato in diversi modi…
Vorrei solamente la parte ARTICOLI IN EVIDENZA con i link…
IL CODICE è inserito nella pagina con EXECPHP
** Questo è il codice che mi da entrambi ovvero sia “solo i link” che gli articoli **
<h2>Articoli In Evidenza</h2>
<?php query_posts(‘category_name=Info&posts_per_page=2’); ?>
-
<?php if (have_posts()) : while(have_posts()) : the_post(); ?>
-
“><?php the_title(); ?>
<?php the_time(‘j F Y’); ?>
<?php endwhile; endif; ?>
Grazie
-
“><?php the_title(); ?>
-
26 Novembre 2010 alle 12:20 #78971SteveAglAmministratore del forum
Rileggiti.. e poi dicci se secondo te è chiaro quel che hai scritto.. rispiega bene.. perchè prima parli di riassunti e testi conpleti.. poi parte di articoli in evidenza.. poi mostri un cdiuce dove c’è solo il titolo e NON the_content o the _excerpt non posso ne volgio perdere 10 miuti a immaginare quale sia la domanda giusta e /o scrivere due tonnellate di parole per coprire tutte le possibili risposte alle possibili domande…
-
26 Novembre 2010 alle 12:30 #78972Robby79Partecipante
Hai ragione, mi sono spiegato male:
Il sito in oggetto è: http://www.asdvalentia.com
Vorei emulare una cosa come quella che ho fatto nel widget ovvero inserire solo i titoli linkati delle news che sono in categoria INFO
Come vedi, il codice che ho messo con EXECPHP nella pagina fa il suo lavoro ma non vorrei il dettaglio completo degli articoli (come vedi c’è anche quello)
Spero di essere stato più chiaro…stavo incasinato e non sono riuscito a scrivere bene…
CODICE ATTUALE SUL SITO:
<h2>Articoli In Evidenza</h2>
<?php query_posts(‘category_name=Info&posts_per_page=2’); ?>
-
<?php if (have_posts()) : while(have_posts()) : the_post(); ?>
-
“><?php the_title(); ?>
<?php the_time(‘j F Y’); ?>
<?php endwhile; endif; ?>
Grazie
-
“><?php the_title(); ?>
-
26 Novembre 2010 alle 12:32 #78973Robby79Partecipante
Non riesco a scriverti il codice, mi taglia anche se metto gli apici…
-
26 Novembre 2010 alle 12:53 #78974SteveAglAmministratore del forum
LO metti su pastebin.com e metti il link qua.. comuqnue se nel codice hai the_content o the_excerpt sono quelli che mostrano i contenut…andranno eliminati.. il loop e dissezione di un tema WP sul nostro wiki sono utili strumenti per capire dove metter le mani e cosa fanno le varie parti di un tema.
-
29 Novembre 2010 alle 14:16 #79069Robby79Partecipante
Steve,
la “mia” soluzione era quella di non toccare il codice del template e/o dissezionarlo…
Il motivo è per mantenere l’aggiornamento, qualora ce ne fosse necessità , senza poi ri-modificare il template oppure se deve essere sostituito, non ri-scrivere codice.
Utilizzando php incluso nella pagina con EXECPHP mi sembra la soluzione migliore per quello che voglio ottenere…
Perchè mi inserisce tutto e non solo i link agli articoli??
Dove sbaglio??
Il sito è http://www.asdvalentia.com se vuoi vedere l’anteprima…
Il codice inserito è il seguente…
Attendo un tua risposta e ti ringrazio dell’interessamento…
-
29 Novembre 2010 alle 14:45 #79071SteveAglAmministratore del forum
Se modifichi il tema standard di wp 20ten basta che crei un tema child e lo modifichi… e cosଠse aggiorni non sovrascivi nulla… i temi son fatti per essere modificati nei template… direi che poi se cerchi di modificatre il loop dopo che questo ha già agito.. non funzionerà … poi NON devi modificare un file esistenta ma creare category-info.php e lui userà il category standard per tutto e non per le info…
-
1 Dicembre 2010 alle 6:42 #79132Robby79Partecipante
Steve non mi è chiara una cosa:
Quello che voglio fare è visualizzare questi articoli come testo con un anchor e basta…
Tu parli di creare un file category-info.php ma non ho capito come far rimanere in home page l’impostazione della pagina fissa e in successione questi link agli articoli…
Dove devo includere il codice che mi interessa nella home con quella pagina precisa che creo dal pannello utente??
Il tema è asroma se ti interessa.
Grazie
-
1 Dicembre 2010 alle 7:18 #79134Robby79Partecipante
Ciao Steve,
ho risolto utilizzando un plugin:
– Recent Posts con Post-Plugin Library
Lo installi e poi includi il codice che vuoi nella pagina utilizzando l’altro plugin che avevo installato ovvero EXECPHP.
Per ottenere quello che volevo includi il codice:
<?php if (function_exists(‘recent_posts’)) recent_posts(); ?>
Ho descritto la soluzione cosଠse qualcuno cerca la stessa cosa, può risolvere velocemente il problema.
Grazie comunque dei tuoi consigli.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.