@Chris_k,
good thinking, thanks for pointing me into the right direction.
i came up with this function but your RSS suggestion is much better.
But the RSS way means i
- must enable rss on websiteA? websiteA/feed/
- how to get posts per category? (how do i parse the rss xml nodes???)
<category><![CDATA[News]]></category>
I will take a look into the plugins, meanwhile here's the function i came up with:
/*
function to get content from fashionsolution db
- let op andere prefix table
*/
function getParallelContent($prefix, $showposts, $category_name){
global $wpdb;
//$prefix = "wp_";
$sql = "SELECT ".$prefix."posts.ID, ".$prefix."posts.post_title, ".$prefix."posts.post_content, ".$prefix."posts.post_name,".$prefix."posts.post_type FROM ".$prefix."posts
LEFT
JOIN ".$prefix."term_relationships
ON ".$prefix."posts.ID = ".$prefix."term_relationships.object_id
LEFT
JOIN ".$prefix."term_taxonomy
ON ".$prefix."term_relationships.term_taxonomy_id = ".$prefix."term_taxonomy.term_taxonomy_id
AND (".$prefix."term_taxonomy.taxonomy = 'post_tag' OR ".$prefix."term_taxonomy.taxonomy = 'category')
LEFT
JOIN ".$prefix."terms
ON ".$prefix."term_taxonomy.term_id = ".$prefix."terms.term_id
WHERE ".$prefix."terms.slug = '".$category_name."' AND post_type = 'post' ORDER BY ".$prefix."posts.ID DESC LIMIT ".$showposts.";
";
$rows = $wpdb->get_results( $sql );
return $rows;
}
}