Support » Installing WordPress » Adding menu buttons in Lightword

  • Resolved wheatonpub


    Hi All,

    I am the editor of a very poor college journal, and I’ve been forced to take over webmaster duties because of our lack of funds. I’m an English major with a simple understanding of HTML and CSS, so I’ve found it difficult to track down and change things with the lightword theme.

    All I want to do is be able to add more buttons to the header at the top (like the “home” and “about” buttons). And erase the “subscribe via” rss text (I edited the headertop.jpg to take the orange image out). I’ve looked through the various.php files, and I think I’ve located the important lines in the header.php file (of the lightword folder):

    <div id="top_bar">
    <ul id="front_menu"<?php echo lw_expmenu(); ?>>
    <?php echo lw_homebtn(__('Home','lightword')); ?>
    <?php echo lw_wp_list_pages();  ?>
    <?php echo lw_searchbox(); ?>

    My question is, how do I add more buttons, and how do I link those buttons to posts I’ve created or outside pages?
    If i could edit the HTML of the first page, I could just add another item to the list, but I don’t know how to do it with PHP files without screwing things up. Also, if you have any links to sites dealing php that would be fantastic.

    Your help is much appreciated.


Viewing 14 replies - 1 through 14 (of 14 total)
  • Edward Caissie


    Theme Review Admin, The JellyBeen Man

    If you want to add a static page into your top navigation menu could do something along these lines:

    <div id="top_bar">
    <ul id="front_menu"<?php echo lw_expmenu(); ?>>
    <?php echo lw_homebtn(__('Home','lightword')); ?>
    <li><a href="url-to-your-static-page-goes-here">Static Page</a></li>
    <?php echo lw_wp_list_pages();  ?>
    <?php echo lw_searchbox(); ?>

    Otherwise (from a cursory review of the theme), check your options to see if you are using pages or categories as your navigation items. You may be expecting one and using the other.

    You might also consider visiting the theme web site and leaving a question/comment …

    … hope that helps some.


    Go to Themes settings and select LightWord Settings from there. You’ll find most option for what you need (disable RSS, top logo) there as this is very customisable theme!

    If you wish to add more pages on front many you DON’T HAVE TO dig through PHP files! Simply, in your WordPress, add some PAGES (NOT post) and see in above mentioned LightWord configuration, if you have set to show pages instead of categories on front menu (this is default setting so there should be any problems with that).

    You can even have submenu of front menu. Simply, while adding page select under which page current page will be placed.

    You are welcome to catch me via e-mail (which would be my nick – that is trejder – in domain, as I read this forum not to often. I will be happy to help you, if I only be able to and find some time for that! 🙂


    Much to my chagrin, I figured out that just adding pages added nav item menus. But your code will be useful, since I want to have my static page be called something different than “home”.
    Thanks Cais and Tredjer, that was most helpful!

    Does anyone know how you would go about having both pages and categories in the top nav menu?


    Edward Caissie


    Theme Review Admin, The JellyBeen Man

    Depending on what you have in mind …

    If you are looking for something along the lines of:

    page || page || category || page || category || category || page || etc.

    I would suspect that to be quite involved and a major edit of the theme.

    Something such as:

    page || page || page || ...
    category || category || category || ...
    ... or vice-versa ...

    This would be much more easily introduced but would still require minor theme edits (possibly major edits).

    I was able to suppress the pages (I hate having ALL my pages listed in the top nav bar of any of my sites), and added buttons to the top by adding:

  • blah-blah-blah….

    BUT the buttons look slightly wonky. The text isn’t centered on the button, and the color is slightly different. I think it looks “cheap.”

    Anyone know how to fix the alignment (it’s a matter of top-to-bottom centering, not left-to-right) and color?

My mistake… that “blah blah blah” should have read:

  • ‘ ‘‘ LINK ‘‘ ‘
  • 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:


    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.


    $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.

    I add <li><a href="forum">Forum</a></li> in header, after <?php echo lw_homebtn(__('Početna','lightword')); ?>, but is not in center … look here. Whats wrong?

    <li><a class="s" title="title" href="your-link"><span>your name</span></a></li>

    Hi ecommerce,

    Your suggestion worked fine…

    However, is there any way of modifying this code so that only one of the categories display instead of all.

    I don’t need to display all.

    Oh by the way I removed the top-level container.


    Hi, this is what i was looking for and it works. Thanks.
    The only problem is the the new button has that darker color of the current page, even if it’s not the current page. Any idea how to fix it?

    you can view it here:

    tried Ecommerce’s suggestion and it works fine for me..

    thanks a lot man.

    skyblogz, don’t you have the same problem with the button being darker?

    Viewing 14 replies - 1 through 14 (of 14 total)
    • The topic ‘Adding menu buttons in Lightword’ is closed to new replies.