The MU forums have moved to WordPress.org

Use sub blog header images on main site? (4 posts)

  1. ja4
    Member
    Posted 13 years ago #

    Not sure if this is the right place to be posting this, so hopefully a mod can move it if not.

    I'm currently building a site in MU which consists of one main site, with 5 subsites. I've got an area of the frontpage of the main blog which is intended to display the custom header image of each blog, and for each image to link to the relevant blog. My code currently looks like this:

    foreach($blogs as $blog){
            $blog_details = get_blog_details($blog->blog_id);
            echo '<div id="' . $blog_details->blog_id .'"><a href="'. $blog_details->siteurl .'">' . $blog_details->blogname .'</a></div>';
        }

    I've been trying to add the custom headers by applying the header images as the background of each div, but nothing I've tried so far seems to work. If anyone could help me out, or even tell me that it can't be done (although I can't see why it shouldn't be doable), I'd be hugely grateful.

    Thanks in advance!

  2. ja4
    Member
    Posted 13 years ago #

    no idea, anyone??

  3. r@keshD
    Member
    Posted 13 years ago #

    Modify above code as:

    $blog_list = get_blog_list( 0, 'all' );
    foreach ($blog_list AS $blogs) {
    	$blog_details = get_blog_details($blogs['blog_id']);
       echo '<div id="' . $blog_details->blog_id .'"><a href="'. $blog_details->siteurl .'">' . $blog_details->blogname .'</a></div>';
    }
  4. ja4
    Member
    Posted 13 years ago #

    Thanks for the reply.
    The code I'm using works, but what I'm trying to do is pull the custom header image from each blog and apply it as the background image of each div.
    Any idea if this can be done?

    Cheers!

About this Topic