The MU forums have moved to WordPress.org

Permalink in template based on Blog ID? (2 posts)

  1. halkibsi
    Member
    Posted 14 years ago #

    Hello,
    I am using WPMU to run several blogs on one site, and what I am trying to accomplish here is linking the blogs together through their templates. Now I can do that by adding a true URL link in the template like this:
    http://blog1.domain.com
    http://blog2.domain.com
    http://blog3.domain.com

    But this is not a realistic way of linking because the blog's URL might change later.

    I want to do it in such a way that the link tag should look like this:
    <a href="<?php bloginfo('url.blogID.1'); ?>">Blog 01</a>

    This way the permalink, should it be updated later on, won't force me to update my code. Is this possible? If so, what is the proper code?

    Thanks!
    Haitham

  2. halkibsi
    Member
    Posted 14 years ago #

    ok, i found the answer...

    <?php $blog_id = 7; echo get_blogaddress_by_id( $blog_id ); ?>
    this will enable you to alter the blog_id number and it will spell out the permalink of that blog.

    :)

About this Topic

  • Started 14 years ago by halkibsi
  • Latest reply from halkibsi