Forum Replies Created

Viewing 1 replies (of 1 total)
  • I wanted a similar feature for Lightword Top-bar Front-Menu to include both Pages and Categories and did it by adding the following three lines of code as outlined below, and some styling changes which I am not posting, since everyone has different CSS preferences:

    Where:

    in lightword/functions.php
    after function lw_wp_list_pages(){
    before 2nd return $top_list;

    You must leave your WP Admin -> Appearance -> Lightword Settings -> “Show categories on front menu” checkbox unchecked. Of course you could recode this to work the other way around, but that would not necessarily serve a purpose, as you can reorganize within the second block (i.e. after else) if needed.

    What:

    $top_listC = wp_list_categories("echo=0&depth=2&title_li=&exclude=".$lw_exclude_categories."");
    $top_listC = str_replace(array('">','</a>','<span><a','current-cat"><a'),array('"><span>','</span></a>','<a','"><a class="s"'), $top_listC);
    $top_list .= '<li class="page-item"><a href="" onClick="javascript: void();" ><span>By Category</span></a><ul>' . $top_listC . '</ul></li>';

    In my case, I have far less pages than categories, and have included all categories in a “By Category” top-level container. You may simple use the following lien instead of the third one above to have your top-level categories listed on their own outside of the “By Category” container, even though this would create usability issues in most cases due to pages andcategories being mixed, so take utmost care and do some usability testing to make sure the logical navigation structure makes sense.

    $top_list .= $top_listC;

    And last, do this at your own risk with a lot of testing!!! and remember to modify the necessary CSS in lightword/style.css -> /* FRONT MENU */. As an example you can add:

    #front_menu ul ul {border-top: 1px #ACACAB solid;}
    For adding a top-border to sub-menu fly-outs.

    #front_menu li ul ul {left: 3em;}
    To push sum-menu fly-outs further to the right in order to allow for easier navigation between items on the main drop-down.

    You can see it on Managing E-commerce Blog where we plan to add some type of a “by Tag” menu to the top-bar front-menu as well.

Viewing 1 replies (of 1 total)