
Originally Posted by
giuly
Can I only insert a post on main page?
I have tried this code on main page , but I don't see the post
<fieldset>
<legend>Latest Post</legend>
<?php
$posts = get_posts(‘numberposts=5‘);
foreach($posts as $post) :
setup_postdata($post);
?>
<a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a>
<?php /*the_content();*/ ?>
<br />
<?php endforeach; ?>
</fieldset>
please...
in this mode I see only the post and blog remains separated, in way to not conflict with simple seo url?
Thank you in advance

Show wordpress posts on main page of zencart..
Post following code into define_main_page.php
Code:
<?php
require('./wp-blog-header.php');
?><?php
$posts = get_posts('numberposts=2'); // change to whatever number of posts to show
foreach($posts as $post) :
setup_postdata($post);
?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_date(); ?>
<?php the_content(); ?><hr />
<?php endforeach; ?>
Alter 2, marked red, to number of posts to show..
Bookmarks