I am designing a website for someone at the moment and they want a preview of thier wordpress blog on thier home page(not blog home page)

Is there a good way to do this automatically so that it updates itself whenever a new blog is posted or will it be a lot easier to just do it manually?

I have a completly free reign over what languages and how the home page will be coded.

Any help greatly appreciated.

Recommended Answers

All 3 Replies

just parse the xml from the rss feed...

<?PHP
 
	/******************************************************************************************************************
	   RSS PARSING FUNCTION
	******************************************************************************************************************/
 
	//FUNCTION TO PARSE RSS IN PHP 4 OR PHP 4
	function parseRSS($url) { 
 
	//PARSE RSS FEED
        $feedeed = implode('', file($url));
        $parser = xml_parser_create();
        xml_parse_into_struct($parser, $feedeed, $valueals, $index);
        xml_parser_free($parser);
 
	//CONSTRUCT ARRAY
        foreach($valueals as $keyey => $valueal){
            if($valueal['type'] != 'cdata') {
                $item[$keyey] = $valueal;
			}
        }
 
        $i = 0;
 
        foreach($item as $key => $value){
 
            if($value['type'] == 'open') {
 
                $i++;
                $itemame[$i] = $value['tag'];
 
            } elseif($value['type'] == 'close') {
 
                $feed = $values[$i];
                $item = $itemame[$i];
                $i--;
 
                if(count($values[$i])>1){
                    $values[$i][$item][] = $feed;
                } else {
                    $values[$i][$item] = $feed;
                }
 
            } else {
                $values[$i][$value['tag']] = $value['value'];  
            }
        }
 
	//RETURN ARRAY VALUES
        return $values[0];
	} 
 
 
	/******************************************************************************************************************
	  SAMPLE USAGE OF FUNCTION
	******************************************************************************************************************/
 
	//PARSE THE RSS FEED INTO ARRAY
	$xml = parseRSS("http://worldthreat.net/?feed=rss2");
 
	//SAMPLE USAGE OF 
	foreach($xml['RSS']['CHANNEL']['ITEM'] as $item) {
	        echo("<p class=\"indexBoxNews\"><a href=\"{$item['LINK']}\" target=\"_blank\" class=\"indexBoxNews\">{$item['TITLE']}{$link}</a></p>");
	}
 
?>

Wordpress preview lugins at wordpress.com
Wordpress latest posts plugins at wordpress.com
a bunch of other plugins from various other providers
hav no experience as which ones work best,

thats amazing work world threat.

With that php script its literlly dump the whoe thing in the div i want i to appear in and change

//PARSE THE RSS FEED INTO ARRAY
	$xml = parseRSS("http://worldthreat.net/?feed=rss2");

to reflect the actually addres of the rss feed in the blog?

Or do

'RSS']['CHANNEL']['ITEM']

all need defining somehow as well.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.