I do not want my RSS feed to include the entire text of the posting. I want it to only output the first 50 words as a description field to force people back to the site if they want to read the entire posting. Currently, there are three fields in the xml file that contain the entire posting. $article_description, $article[atom_content], $article[content][encoded] all include the entire post in them by default.
Therefore, I need some changes to the external.php file. Here is what I need to do for each the RSS, RSS1, RSS2, and XML feeds:
However, this is not working to truncate the description as I intended.
Can someone help me comment out each of the full content fields and truncate the test in the description field? I have made several attempts at searching the internet for this over the last few weeks and have not been able to find the answer.
Thank you.
Therefore, I need some changes to the external.php file. Here is what I need to do for each the RSS, RSS1, RSS2, and XML feeds:
- Remove the two content fields - $article[atom_content] & $article[content][encoded]
- Truncate the text in the description field to 50 words $article_description
Code:
// added to test truncating the text preg_match("/([\S]+\s*){0,50}/", $description, $description); $description = trim(description[0]); // end addition for truncating text
Can someone help me comment out each of the full content fields and truncate the test in the description field? I have made several attempts at searching the internet for this over the last few weeks and have not been able to find the answer.
Thank you.
Comment