Hello! The thing is, I need to show posts from the child of the blog in the parent
Already the second day I am looking for a solution I can not find.
that is, I have the main page, it is also like a blog. I need to show the last 4 posts from another blog on it.
Before that, I had to do the same thing, but the main page was static. Everything was without problems.
but from blog to blog does not work
Here is the code I use for the static page, but for the dynamic page it does not work

  • "> read article

    • Need to show posts in full or preview posts? - Russian Bear

    1 answer 1

    Here is the code I use for a static page, but for a dynamic page it does not work:

    $path = get_home_path(); $path2 = $path .'blog/wp-blog-header.php'; require($path2); global $post; $myposts = get_posts('numberposts=3&category_name=blog'); foreach($myposts as $post) : setup_postdata($post); ?> <?php endforeach;?> <pre><?php print_r($myposts) ?></pre>