Forums

[resolved] Different container id for different blog (4 posts)

  1. Langy
    Member
    Posted 7 months ago #

    Hi all,

    I want to assign 2 different classes for each blogs linked to my WPMU.
    I want to put a code in the header.php like this:

    <div id="conteiner" <?php if (is_blog == 1): ?>class="blog1"<?php else: ?> class="blog2"<?php endif;?>>

    But I did not find an existing function that checks the id of the blog.

    Someone can help me?
    Thanks

  2. keesiemeijer
    moderator
    Posted 7 months ago #

    Try it with:

    <?php
    global $blog_id;
    if ($blog_id == 1) {
       //do something
    } else {
       //do something else
    }
    ?>
  3. Langy
    Member
    Posted 7 months ago #

    wonderful, it works!

    Thanks keesiemeijer

  4. keesiemeijer
    moderator
    Posted 7 months ago #

    You're welcome. Glad you got it resolved.

Reply

You must log in to post.

About this Topic