The MU forums have moved to WordPress.org

How to modify the header bar (11 posts)

  1. skepticblogs
    Member
    Posted 17 years ago #

    I'm very pleased with WPMU, except for a problem with the header bar.

    On http://skepticblogs.com , the header bar has a navigation menu with "Main blog" and "Get a blog". But these two links point to http://domain.tld

    How do I change the links so that they point at http://skepticblogs.com ?

    Also, how can I or individual authors, get rid of the header navigation bar?

  2. GiGaBiT
    Member
    Posted 17 years ago #

    To edit the header, go to your themes directory:
    wp-content/themes/

    and edit your header.php

    whichever theme you edit your header.php file for, will be site wide, even for individual authors.

    You can also, enable themes, choose one you want for YOUR theme, enable it, then go back and disable that particular theme and nobody else can choose it.

    it is a good way for you to have a "seperate" look to your site.

    all in all, header.php is the file to edit...

    hope that helps

  3. skepticblogs
    Member
    Posted 17 years ago #

    I think I'm being misunderstood. If you go to http://skepticblogs.com right at the very top (above the header is a navigation bar whose links are wrong.

    Can someone help?

  4. GiGaBiT
    Member
    Posted 17 years ago #

    I understand you completely, you must edit your header.php file for that particular theme.

  5. kahless
    Member
    Posted 17 years ago #

    I believe the directions say something about uncommenting lines to get it to work with Random Blog. Basically you need to edit the mu-admin-bar.php file which you put in mu-plugins and change domain.tld to your domain. I have no way of knowing ahead of time what your domain is and so didn't want to hard code something. The comments in the mu-admin-bar.php file should spell out very clearly what you need to edit.

  6. lunabyte
    Member
    Posted 17 years ago #

    I have no way of knowing ahead of time what your domain is and so didn't want to hard code something.

    MU does have vars for this. ;)

  7. kahless
    Member
    Posted 17 years ago #

    Are they documented? Is there a consistent way to get the domain of the main blog that will work with people who seem to be running MU sites with different domains sharing one code base? I started the plugin mainly for my own needs and then people were looking for something that had the functions the admin bar had. I admit I am not intimately familiar with all the vars MU now has. I am also not sure the var was their when I was working on this. If someone points out where to find the vars, I'll look at modifying the plugin.

  8. lunabyte
    Member
    Posted 17 years ago #

    global $current_site;

    Vars you're interested in would be:

    $current_site->domain
    $current_site->path

    <a href="$current_site->domain . $current_site->path">

    etc.

    This comes from the "sites" table, and corresponds to the current domain, not the actual "blog".

  9. kahless
    Member
    Posted 17 years ago #

    I did

    $main_blog = $wpdb->get_results("SELECT * FROM $wpdb->blogs WHERE blog_id = '1'");
    $domain = $main_blog[0]->domain;
    $path = $main_blog[0]->path;
    $main_url = 'http://' . $domain . $path;

    which seems to work. I'll give this a try. Thanks.

  10. kahless
    Member
    Posted 17 years ago #

    lunabyte,

    Yours doesn't seem to work instead of getting domain.tld/. I get subdomain.domain.tld/domain.tld/ with your code. Haven't had a chance to troubleshoot yet.

  11. lunabyte
    Member
    Posted 17 years ago #

    I might be a little of on the order, but that should do the trick.

    For yours, you should be looking in the sites table.

About this Topic

  • Started 17 years ago by skepticblogs
  • Latest reply from lunabyte