==== Create a Blog Announcements Box ==== {{:tutorials:zencartmods:announce.jpg?|}} === Create an Anouncements Category === Use Wordpress and create a category called 'announce', and populate it with a few posts. Test to see that the rss feed works. If you're using some sort of nice URLS, it'll look like http://www.yourblog.com/feed/announce If not, it may look more like http://www.yourblog.com/?feed=rss2&category_name=announce === PHP / DOM === Put this in **includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php** (we put it at the very bottom).
load($filename); $item = $xml->getElementsByTagName('item')->item(0); $post_title = $item->getElementsByTagName('title')->item(0)->nodeValue; $post_link = $item->getElementsByTagName('link')->item(0)->nodeValue; $post_encoded = $item->getElementsByTagName('encoded')->item(0)->nodeValue; $post_text = substr(strip_tags($post_encoded, '

'), 0, 500); // strip out common tags here if($post_text != strip_tags($post_encoded, '

')) { // add read more tag $pre_cut = 499; while( substr($post_text, $pre_cut, 1) !== ' ' && $pre_cut > 0) { $pre_cut--; } $post_text = substr($post_text, 0, $pre_cut); $post_text .= '... Read More ...'; } $post_text = str_replace('

', '', $post_text); // find the first image of the post $matches = array(); preg_match('/
This will work for rss feeds generated by Wordpress, but you'll have to add CSS and style it for your own website.