WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] php help in K2 theme requested (2 posts)

  1. Starkmann
    Member
    Posted 7 years ago #

    So I am having trouble with a blog I am helping with. It has two categories, news and training. each one is it's own separate tab at the top of the screen. By clicking on the tab, you go to the archive page for the respective category. The tabs have the following code on them:

    <li class="<?php if (((is_home()) && !(is_paged())) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>">Blog</a></li>

    I would like to know how to change this code so that one tab stays highlighted for category 1 and the other only for category 2.

    The page is http://bemoretraining.com/blog

    Thank you very much

  2. Starkmann
    Member
    Posted 7 years ago #

    So, I fixed it.

    The code listed above now reads:
    <li class="<?php if ((is_home())or (is_category('1'))){ ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>">Blog</a></li>

    I have some very similar code to make the second tab work for it's own category.

    So there is a cheap and easy hack for two blogs on one install. sorta

Topic Closed

This topic has been closed to new replies.

About this Topic