Forums

RSS feed - some categories generated as excerpts, others as full posts (4 posts)

  1. fringer
    Member
    Posted 6 months ago #

    I'm having a weird problem on my wp site - RSS feed is being generated very strangely. I have it setup to show just excerpts, but the feed displays all posts in certain categories as excerpts, and in some displays them as full posts.

    The categories always behave the same - some are always excerpts, some are always full posts. How can I fix this?

  2. prionkor
    Member
    Posted 6 months ago #

    Can you give some of your feed url here?

    1. One which is working fine.
    2. One which displaying full posts.

  3. fringer
    Member
    Posted 6 months ago #

    I can't. Any suggestions what to check?

  4. fringer
    Member
    Posted 5 months ago #

    I think I got it.

    In my functions file I added a piece of code for displaying the post thumbnail if it exist. The code looks like this:

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

    And now that I've checked, yes, all the categories/posts that have images are displayed full. How can I change that code to have only the excerpt?

Reply

You must log in to post.

About this Topic