Home › Forum › Amministrazione WP › RSS + informazioni
-
AutorePost
-
-
21 Ottobre 2010 alle 11:37 #15354ZaRBoR2Partecipante
Slave, vorrei dei chiarimenti su rss di wordpress, in quanto li trasmetto con i feed su facebook e con feedburner di google, allora la situazione è questa:
Negli articoli vorrei che si vedesse ( via rss ) l’immagine 140×140 che allego e sotto l’articolo ( tagliato ovviamente, perché rss taglia l’articolo ) un link con scritto continua $nomearticolo a leggere su:… etc
Avete consigli oppure conoscete qualche plug in che faccia ciò?
-
21 Ottobre 2010 alle 11:48 #77850SteveAglAmministratore del forum
http://wordpress.org/extend/plugins/rss-footer/
http://wordpress.org/extend/plugins/wp-rss-images/
Se ben fatti dovrebbero funzionare assieme senza problemi
-
21 Ottobre 2010 alle 12:03 #77851ZaRBoR2Partecipante
Grazie mille era proprio quello che mi serviva
-
21 Ottobre 2010 alle 13:44 #77861ZaRBoR2Partecipante
Veramente il plug in delle immagini non funziona… quelle che ho allegato… non vengono visualizzate… cosa devo fare? ( uso l’ultima versione di wordpress )
-
21 Ottobre 2010 alle 23:04 #77875ZaRBoR2Partecipante
Meglio che mi correggo, dopo aver fatto opportuni test, plug in funziona solo su rss di internet explorer, e poi l’immagine caricare è solo un link, e viene messo nel footer degli rss… quindi rss images non fa veramente al mio caso… l’immagine deve essere messa nell’header e deve essere visibile… grazie ancora steve vedi se puoi esaudire questo mio desiderio xd
-
21 Ottobre 2010 alle 23:32 #77876ZaRBoR2Partecipante
Ho risolto mettendo questo codice in functions.php del mio tema… cosଠcome è adesso negli rss inserire la thumbail ( 150×150 generalmente )
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') .
'</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');
Se volete a dimensione originale basta inserire questo:
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) .
'</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');
-
22 Ottobre 2010 alle 9:58 #77880ZaRBoR2Partecipante
Stranamente in questo codice c’è qualcosa che non va… gli rss me li vede come rss2…. in più non mi fa vedere nemmeno il footer del plug in…. consigli?
-
22 Ottobre 2010 alle 11:51 #77885ZaRBoR2Partecipante
quello che scaturisce l’anomalia è “get_the_content();” con quale funzione posso risolvere…?
-
22 Ottobre 2010 alle 13:33 #77892SteveAglAmministratore del forum
che se hai il $contet non gli aggiungi ancora se stesso ci attacchi davanti la thumb e poi se stesso:
$content = ‘<p>’ . get_the_post_thumbnail($post->ID, ‘thumbnail’) .
‘</p>’ . $content;
Per il resto non ho capito nulal su rss2 etc
-
23 Ottobre 2010 alle 13:11 #77906ZaRBoR2Partecipante
Scusa SteveAgl mi sono espresso male, mi spiego meglio in modo che lei possa capire:
$content è il contenuto che sara visualizzata sotto il titolo dell’articolo ( RSS )
Quindi:
Titolo dell’articolo
Contenuto.
Quindi con questa operazione:
$content = ‘<p>’ . get_the_post_thumbnail($post->ID, ‘thumbnail’) .
‘</p>’ . get_the_content();
Otterremo:
Titolo dell’articolo
Contenuto
E all’interno di contenuto vi sarà :
thumbnail -> ( ovvero: get_the_post_thumbnail($post->ID, ‘thumbnail’) )
testo libero ( ovvero: get_the_content(); )
Comunque ho avuto nuove idee in questi giorni e devo fare dei test, questo articolo era solo a scopo illustrativo grazie, mi farò risentire e grazie.
-
23 Ottobre 2010 alle 13:36 #77908SteveAglAmministratore del forum
NO la funzione che usi tu riceve $content come parmetro dal filtro e li c’è già il contenuto… quindi:
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = ‘<p>’ . get_the_post_thumbnail($post->ID) .
‘</p>’ . $content;
}
return $content;
QUindi ricevi il content e davanti ci aggiungi la thumb
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.