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

Jak naprawić ukrywanie treści paginacji wpisów WordPress w kanale RSS?

Niedawno jeden z naszych użytkowników poskarżył się nam, że paginacja wpisów WordPress ukrywa pełną treść na kanale RSS. Po szybkich poszukiwaniach okazało się, że jest to błąd rdzenia WordPress(#10984), który został zgłoszony 4 lata temu i nadal nie został naprawiony. W tym artykule pokażemy, jak poprawić ukrywanie treści paginacji postów WordPress w kanałach RSS.

Problem pojawia się, gdy podzielisz swoje wpisy WordPress na wiele stron, a jeśli ustawiłeś kanały RSS na wyświetlanie pełnego tekstu, wówczas twoje kanały RSS będą wyświetlać tylko treść pierwszej strony wpisu (tj. przed tagiem <!--nextpage--> ).

Na szczęście jeden ze współautorów, Simon Wheatley, opublikował obejście, które poprawi ten błąd.

Wszystko, co musisz zrobić, to dodać ten kod w pliku functions.php twojego motywu lub we wtyczce specyficznej dla witryny:

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 );

.

Powyższy kod dodaje filtr do the_content, umożliwiając kanałom wyświetlanie pełnej treści wpisów i ignorowanie paginacji (zobacz więcej przykładów dodawania treści na kanałach RSS). Miejmy nadzieję, że problem ten zostanie wkrótce rozwiązany w przyszłej wersji WordPressa. Do tego czasu to obejście zapewni, że twoi subskrybenci otrzymają pełną treść w swoim czytniku RSS.

Mamy nadzieję, że ten artykuł pomógł ci poprawić problem paginacji wpisów WordPress w kanałach RSS. Daj nam znać, co myślisz, zostawiając komentarz poniżej lub dołącz do nas na Twitterze i 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 komentarzeLeave 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.