Support » Themes and Templates » HELP! Alternate Look of Horizontally Listed Categories

  • Hi all–

    I am trying to make a horizontal menu from WP categories — however, I am running into a bit of trouble when it comes to styling them.

    Ideally, I’d like the categories to alternate colors (odd is one color, even is another). The closest example I can find to what I want to do is something like that of the Arthemia theme:

    What is a way to do this so that the menu will be able to stay at the top of the page & still have pages show? (I’ve tried dissecting the Arthemia theme, but I get an error when I place the middle menu on page.php, for instance.)

    Is there a way you can edit the

  • tag perhaps of the wp_ list_categories function? I can’t seem to find an answer online!
  • Thanks in advance!

Viewing 1 replies (of 1 total)
  • Hi

    Just a few lines of jQuery code will do the alternate striping for you. It will automatically add the classes of odd and even, which you then style in the CSS.

    Here is an article about how to do this
    What you do to load jquery in wp is add this line of code
    <?php wp_enqueue_script('jquery'); ?>
    before the
    <?php wp_head(); ?> line in your theme’s header.php file

    The other jquery code discussed in the article gets added after
    <?php wp_head(); ?>

    You do not need to load the jquery library, which the article will discuss, as the enqueue statement does that for you. The article discusses striping a vertical list, but its exactly what you want to do except you are displaying the list horizontally.
    Also, in WordPress replace all occurences of the dollar sign $ in the script with the word jQuery capitalized exactly like that

    wp_list_categories creates the UL / LI HTML structure the article discusses

Viewing 1 replies (of 1 total)
  • The topic ‘HELP! Alternate Look of Horizontally Listed Categories’ is closed to new replies.