Hi, I'm trying to integrate wordpress posts to yetishare frontpage,
I created a forlder named "blog" in my host root and installed wordpress on it,
and for integrating wordpress in the main site I should first grab the wordpress blog header using this:
then with this code I should be able to get latest posts:
I created a php file named "_index_blog_section.inc.php" in "templates/partial" directory of my theme and put these two blocks in there,
and with putting the following code in the "index.html" file of my theme:
I should be able to get my posts from blog, but when I upload these files, the whole site goes blank! and nothing shows up.
so my question is, what am I doing wrong? please help me out?
thanks a lot
I created a forlder named "blog" in my host root and installed wordpress on it,
and for integrating wordpress in the main site I should first grab the wordpress blog header using this:
Code:
<?php
define('WP_USE_THEMES', false);
require(WEB_ROOT . '/blog/wp-blog-header.php');
?>
Code:
<?php
// Get the last 3 posts.
global $post;
$args = array( 'posts_per_page' => 3 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br />
<?php endforeach; ?>
and with putting the following code in the "index.html" file of my theme:
Code:
<?php include_once(SITE_TEMPLATES_PATH . '/partial/_index_blog_section.inc.php'); ?>
so my question is, what am I doing wrong? please help me out?
thanks a lot