• fitzpatrick512

    (@fitzpatrick512)


    Having trouble inserting some custom links in to the nav bar on the “excellence” theme.

    It tried this, and it works fine in Firefox, but breaks in IE.

    <li class="page_item"<a href="http://www.billsboardonline.com/">Home</a></li><li class="page_item"<a href="http://www.billsboardonline.com/Classifiedads/">Classifieds</a></li><li class="page_item"<a href="http://www.billsboardonline.com/advertising.php">Advertise with Us</a></li><li class="<?php if (((is_home()) &amp;&amp; !(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 Home<?php echo $langblog;?></a></li>

    The biggest problem here is that I don’t really understand everything going on here:

    <li class="<?php if (((is_home()) &amp;&amp; !(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 Home<?php echo $langblog;?></a></li>

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

    (@esmi)

    I’m not surprised it didn’t work. 3 out the 4 opening li tags weren’t properly formed. Plus the PHP syntax for ‘or’ is ‘||’.

    Translation: If (this is the home page AND it isn’t paged) OR it’s an archive page OR a single post OR has a number of pages OR is a search result page, then assign it the class “current_page_item”. Otherwise, assign it the class “page_item”.

    Corrected code: http://wordpress.pastebin.ca/1409811

    esmi

    (@esmi)

    Double post removed

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

The topic ‘custom nav bar items’ is closed to new replies.