kala-tamin WordPress: Custom footer links doesn't show active state


WordPress: Custom footer links doesn't show active state



Because I'm using a couple of custom post types and two languages I decided not to use WP's own menu function, and used these conditional statements instead -

<div class="navigation"> <ul>     <li><a <?php if(is_page('home') || is_page('hem')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo(url) . '">Home'; } else { echo 'href="' . get_bloginfo(url) . '">Hem'; } ?></a></li>     <li><a <?php if(is_page('offers') || is_page('erbjudanden') || in_category('offers') || in_category('erbjudanden')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo('url') . 'offers">Offers'; } else { echo 'href="' . get_bloginfo('url') . '/erbjudanden">Erbjudanden'; } ?></a></li>     <li><a <?php if(is_page('properties-spain') || is_page('fastigheter-spanien')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo('url') . 'properties-spain">Properties in Spain'; } else { echo 'href="' . get_bloginfo('url') . '/fastigheter-spanien">Fastigheter i Spanien'; } ?></a></li>     <li><a <?php if(is_page('properties-usa') || is_page('fastigheter-usa')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo('url') . 'properties-usa">Properties in USA'; } else { echo 'href="' . get_bloginfo('url') . '/fastigheter-usa">Fastigheter i USA'; } ?></a></li>     <li><a <?php if(is_subpage('information') || is_subpage('radgivning')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo('url') . 'information/process-of-purchase">Information'; } else { echo 'href="' . get_bloginfo('url') . '/radgivning/hur-ett-kop-gar-till">Rådgivning'; } ?></a></li>     <li><a <?php if(is_page('about-us') || is_page('om-oss')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo('url') . 'about-us">About us'; } else { echo 'href="' . get_bloginfo('url') . '/om-oss">Om oss'; } ?></a></li>     <li class="last"><a <?php if(is_page('contact') || is_page('kontakt')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . get_bloginfo('url') . 'contact">Contact'; } else { echo 'href="' . get_bloginfo('url') . '/kontakt">Kontakt'; } ?></a></li> </ul> </div> 

Now this works excellent including it in the header file but in the footer file only some of the links are given a class of active when on the actual page. All the items in the menu exists as pages, with one version for each language (swedish and english). This error just seems really weird and I've tried checking with different conditional parameters such as page title, page id etc. with no results. Any ideas?


How do I add another avatar to the wordpress default ones?

1:

In WordPress how do you register built-in taxonomies with custom post types in code?
Sometimes queries higher up in the template source will corrupt the output of conditional tags lower down (i.e. WordPress Custom Post Types - Pretty Permalinksin your footer). I want to learn wordpress from scratch. How can I learn? [closed] The trick is to put wp_reset_query() before you use them in your footer include:. How do I stop Wordpress from writing single quotes in the HEAD tag?
    <?php wp_reset_query(); ?>     <div class="navigation">     <ul>         <li><a <?php if(is_page('home') || is_page('hem')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . how to use plus sign instead dashes in wordpressreceive _bloginfo(url) . Wordpress loop show limit posts'">Home'; } else { echo 'href="' . Twenty Ten, dropdown menu appearing with fade effectreceive _bloginfo(url) . '">Hem'; } ?></a></li>         <li><a <?php if(is_page('offers') || is_page('erbjudanden') || in_category('offers') || in_category('erbjudanden')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . receive _bloginfo('url') . 'offers">Offers'; } else { echo 'href="' . receive _bloginfo('url') . '/erbjudanden">Erbjudanden'; } ?></a></li>         <li><a <?php if(is_page('properties-spain') || is_page('fastigheter-spanien')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . receive _bloginfo('url') . 'properties-spain">Properties in Spain'; } else { echo 'href="' . receive _bloginfo('url') . '/fastigheter-spanien">Fastigheter i Spanien'; } ?></a></li>         <li><a <?php if(is_page('properties-usa') || is_page('fastigheter-usa')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . receive _bloginfo('url') . 'properties-usa">Properties in USA'; } else { echo 'href="' . receive _bloginfo('url') . '/fastigheter-usa">Fastigheter i USA'; } ?></a></li>         <li><a <?php if(is_subpage('information') || is_subpage('radgivning')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . receive _bloginfo('url') . 'information/process-of-purchase">Information'; } else { echo 'href="' . receive _bloginfo('url') . '/radgivning/hur-ett-kop-gar-till">Rådgivning'; } ?></a></li>         <li><a <?php if(is_page('about-us') || is_page('om-oss')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . receive _bloginfo('url') . 'about-us">About us'; } else { echo 'href="' . receive _bloginfo('url') . '/om-oss">Om oss'; } ?></a></li>         <li class="last"><a <?php if(is_page('contact') || is_page('kontakt')) { echo 'class="active" '; } if (ICL_LANGUAGE_CODE == 'en') { echo 'href="' . receive _bloginfo('url') . 'contact">Contact'; } else { echo 'href="' . receive _bloginfo('url') . '/kontakt">Kontakt'; } ?></a></li>     </ul>     </div> 


95 out of 100 based on 70 user ratings 945 reviews