• Resolved cocacooler

    (@cocacooler)


    hello all,

    I have googled a lot of different soloutions for my sitation yet unable to solve it. I hope someone can help me fix this code for me. I am having problem with second statement if – is/in category is not working. can someone help me fix it or optimise it please.

    <?php if(is_page()){ ?>
    <div class=”HelloBar”>
    <?php if (is_page( array( 5,140, 106, 113,130, 56, 133, 127, 124, 110, 94) )) { ?>
    <ul class=”HelloBar-info”>
    <?php wp_list_categories(‘include=8,9&title_li=&orderby=id’); ?>

    <?php } ?>
    <?php if (in_category( array (‘8’, ‘9’))) { ?>
    <ul class=”HelloBar-info”>
    <?php wp_list_categories(‘include=8,9&title_li=&orderby=id’); ?>

    <?php } ?>
    <?php if ( ! dynamic_sidebar( ‘sidebar-five’ ) ) : ?>
    <?php endif; // end sidebar widget area ?>

    <div class=”contact”>
    <?php if (function_exists (eemail_show)) eemail_show(); ?>
    <div class=”clear”></div>
    </div>
    </div><!–/HelloBar–>
    <?php } else { ?>
    <div class=”HelloBar”>
    <ul class=”HelloBar-info”>
    <?php wp_list_categories(‘include=8,9,10,11,12,13&title_li=&orderby=id’); ?>

    </div><!–/HelloBar–>
    <?php } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • the ‘in_category()’ conditional is wrapped in the first ‘is_page()’ conditional and is therefore never checked.

    there are also a lot of opening or closing html tags in various conditional sections which might lead to invalid code.

    double check where you want to end each conditional statement;

    or describe your conditional structure with words …

    Thread Starter cocacooler

    (@cocacooler)

    u solved my issue 🙂

    i changed it to <?php if(is_page() || is_category()){ ?>

    and now working fine..

    thanks

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

The topic ‘condtional categories’ is closed to new replies.