The MU forums have moved to WordPress.org

Drop down list of blogs (4 posts)

  1. carnold
    Member
    Posted 16 years ago #

    I would like to have a drop-down list of x number of blogs on the "home" page. I see where there is a plugin called list-all but i want a drop down list. I also see where wpmu-functions has get_blog_list; is it possible to use this with a drop down?

  2. peiqinglong
    Member
    Posted 16 years ago #

    <?php
    $blogs = get_blog_list();
    if( is_array( $blogs ) ) {
    	?>
    	<ul>
    	<strong>Blogs</strong>
    	<?php foreach( $blogs as $details ) {
    		?><li><a href="http://<?php echo $details[ 'domain' ] . $details[ 'path' ] ?>"><?php echo get_blog_option( $details[ 'blog_id' ], 'blogname' ) ?></a></li><?php
    	}
    	?>
    	</ul>
    	<?php
    }
    ?>

    Try this.

  3. carnold
    Member
    Posted 16 years ago #

    This lists the blogs but does not give a drop down.

  4. lunabyte
    Member
    Posted 16 years ago #

    You'll have to code the html to produce a dropdown instead of a list.

About this Topic

  • Started 16 years ago by carnold
  • Latest reply from lunabyte