Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come correggere la paginazione degli articoli di WordPress che nasconde il contenuto nel feed RSS

Recentemente un nostro utente si è lamentato di chi ci ha segnalato che la paginazione degli articoli di WordPress nascondeva il contenuto completo nel feed RSS. Dopo una rapida ricerca, è emerso che si tratta di un bug del core di WordPress(#10984) segnalato 4 anni fa e non ancora corretto. In questo articolo vi mostreremo come correggere la paginazione degli articoli di WordPress che nasconde il contenuto nei feed RSS.

Il problema si verifica quando dividete i vostri articoli di WordPress in più pagine e se avete impostato i feed RSS per visualizzare il testo completo, i feed RSS visualizzeranno solo il contenuto della prima pagina dell’articolo (cioè prima del tag <!--nextpage--> ).

Fortunatamente uno dei collaboratori, Simon Wheatley, ha pubblicato un articolo che corregge il bug.

È sufficiente aggiungere questo codice nel file functions.php del tema o in un plugin specifico del sito:

1
2
3
4
5
6
7
8
9
function wpb_full_text_for_feeds( $content ) {
    if ( ! is_feed() )
        return $content;
    global $post;
    $content = $post->post_content;
    return $content;
}
 
add_filter( 'the_content', 'wpb_full_text_for_feeds', -100 );

Il codice di cui sopra aggiunge un filtro a the_content, consentendo ai feed di visualizzare il contenuto completo degli articoli e ignorando la paginazione (si vedano altri esempi su come aggiungere contenuti nei feed RSS). Si spera che questo problema venga presto corretto in una versione futura di WordPress. Fino ad allora questo workaround farà in modo che i vostri abbonati ricevano il contenuto completo nel loro lettore RSS.

Speriamo che questo articolo vi abbia aiutato a correggere il problema della paginazione degli articoli di WordPress nei feed RSS. Fateci sapere cosa ne pensate lasciando un commento qui sotto o seguiteci su Twitter e Google+.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

2 commentiLeave a Reply

  1. Amlan Dutta

    How do you make the floating bar float and then stop as soon as the content end is reached ,

    Amlan Dutta

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.