bbPress

Simple, Fast, Elegant

bbPress support forums » Themes

Is this possible? (advanced templating)

(4 posts)
  • Started 1 month ago by Null
  • Latest reply from bobbyh
  • This topic is not resolved

Tags:

  1. Well thisd is what I want. I have 1 forum and it has 2 forum cats. Lets call them forum 1 and forum 2.

    Now I have the kakumei them running (green). Now I want forum 1 to be green, but if they go to forum 2, I want it to be blue (kakumei blue).

    So is it possible to have different colors/themes for each category? Or some dirty hack to do this? This is also need for subforums to give them a different style, but fornow I just need it per category.

    Thanks

    Posted 1 month ago #
  2. bobbyh
    Member

    Yeah, assuming the themes have consistent HTML, in the header, put something like this:

    <link rel="stylesheet" href="<?php if ($forum_id == 1) bb_stylesheet_uri(); elseif ($forum_id == 2) echo '/my-templates/kakumei-blue/style.css'; ?>" type="text/css" />

    I didn't test this, but I think that code should work.

    Posted 1 month ago #
  3. Can this be done with entire templates too? Perhaps in topic.php or something (cant try this at the moment)

    Posted 1 month ago #
  4. bobbyh
    Member

    If you want varying HTML depending on what the forum id is, you should probably just use a conditional if/inside of one template file like so:

    <?php if ($forum_id == 1) {
    echo 'html1';
    } elseif ($forum_id == 2) {
    echo 'html2';
    ?>

    Any other approach will probably lead to madness. :-)

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.