How can I display wordpress post to another site , that is not in wordpress platform?
It is easy to display any part of wordpress content in another platfor site.
For example i have do the following to display recent post into magento CMS.
Just I create a file name showPost in wordpress index folder. and write the following code in it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
.homeShowPost{ padding:0px; margin:0px;} | |
.homeShowPost li{ padding:2px 0 2px 5px; list-style-type:none;} | |
.homeShowPost li a{ font-family:Arial, Helvetica, sans-serif; font-size:13px; text-decoration:none; color:#FFF;} | |
.homeShowPost li a:hover{ text-decoration:underline;} | |
.blogInFrame{} | |
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('WP_USE_THEMES', false); | |
require('wp-load.php'); | |
?> | |
<ul> | |
<?php | |
global $post; | |
$myposts = get_posts('numberposts=5'); | |
foreach($myposts as $post) : | |
setup_postdata($post); ?> | |
<li><a href="<?php the_permalink(); ?>" target="_blank"><?php the_title(); ?></a></li> | |
<?php endforeach; ?> | |
</ul> |
and this file require form magento site, nothing else.
Finally I get the recent five post from magento.