• Hey guys,

    I currently have a few pages setup on my ‘blog’ and some have sub sections while others don’t.

    Here’s the code I’m using…

    <?php if ((is_page(2)) || (is_page(3)) || (is_page(4))) {include (‘sidebar_sub.php’); }
    else {include (‘sidebar_default.php’); }
    ?>

    This is very unreliable to me, as I have to change the code every time I add a new page to the site that uses sub sections.

    ANOTHER HUGE problem I’m having with this code is when I click on one of the sub sections in the main category the actual sub sections disappear from the sidebar.

    Can anyone point me in the right direction where I might be able to resolve this issue?

    Thanks,
    Mario

Viewing 2 replies - 1 through 2 (of 2 total)
  • ANOTHER HUGE problem I’m having with this code is when I click on one of the sub sections in the main category the actual sub sections disappear from the sidebar.

    Since Pages don’t have categories… I don’t really get this “question”.

    Thread Starter Ethics

    (@ethics)

    Let me try to clear it up…

    Page 1
    –Page 4
    –Page 5

    Page 2
    –Page 6
    –Page 7

    Page 3

    I have it setup so that the sub sections only show up in the sidebar when you are on Page 1 or 2. If you are on Page 3 you don’t get a sub menu option.

    Now. The problem is when I click on Page 4-7. Since they don’t have sub sections, I get nothing in the sidebar.

    What I want it to do is show the page 1 sub sections when you click on page 4 or 5, so they don’t dissappear.

    Hopefully thats a little easier to understand, sorry about the confusion.

    Thanks,
    Mario

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘if Sub Categories exist?’ is closed to new replies.