Hello,
the following code returns a blog name which is the same for all blogs (ie, the default blog name), an empty blog description, and empty blog-post categories. Am I doing anything wrong?
Many thanks.
pr
----------------------- code ------------------------
<?php
$blog_list = get_blog_list( 0, 'all' );
foreach ($blog_list AS $blog) {
$blog_id = $blog['blog_id'];
$blog_path = $blog['path'];
// retrieve last n posts
$retrieve_last_n = 10;
$blog_details = get_blog_details($blog_id, true);
$post_count = $blog_details->post_count;
$blogname = $blog_details->blogname;
$description = get_blog_option($blog_id, 'blogdescription');
$post_counter = 0;
$blog_url = $blog_details->siteurl;
echo "<b>Blog $blog_path</b> has $post_count posts.
\n";
echo "The program is authorized to retrieve $retrieve_last_n posts out of a total of $post_count.
\n";
echo "<div class='post_list'>\n";
echo "<h5>$blogname, $blogdescription</h5>\n";
echo "
- \n";
- ID: $post_id, type: $post_type; title: $post_title: category: $post_category \n";
for ($i = $post_count; $i >= 1; --$i) {
$post_title = get_blog_post($blog_id, $i)->post_title;
$post_id = get_blog_post($blog_id, $i)->ID;
$post_name = get_blog_post($blog_id, $i)->post_name;
$post_date = get_blog_post($blog_id, $i)->post_date;
$post_type = get_blog_post($blog_id, $i)->post_type;
$post_category = get_blog_post($blog_id, $i)->post_category;
$post_author = get_blog_post($blog_id, $i)->post_author;
$permalink = get_blog_permalink($blog_id, $i);
if ( $post_type != 'revision' and $post_counter <= $retrieve_last_n ) {
echo "
++$post_counter;
}