• Hi All,

    I’m trying to create a theme with a horizontal page menu with list images. I have this code in header.php:

    <div id="nav"><ul><?php
       $args = array(
          'sort_column' => 'menu_order',
       );
    
       $pages = get_pages($args);
       foreach ($pages as $page){
    		$menu = '<li><a href="'.get_page_link($page->ID).'" title="">'.$page->post_title.'</a></li>';
    		echo $menu."\n";
    	}
     ?></ul></div>

    and this CSS

    #nav ul {
    	display: inline;
    	padding-left: 20px;
    	position: relative;
    	top: 2px;
    }
    #nav ul li {
    	display: inline;
    	font-size: 1.2em;
    	text-transform: none;
    	margin-left: 8px;
    	color:#EEAC55;
    	font-family:times;
    	font-size:16px;
    	font-variant:small-caps;
    }

    When I add list-style-image:url('images/circle.gif'); to #nav ul in the css, it makes the links display in a vertical column rather than horizontally. Any ideas? This is a dev site that is password proteted. If anyone really wants to see it I’ll create a temporary password and post it. Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter Jonas Grumby

    (@ss_minnow)

    I worked this out by adding image tags before the page links (after the li tags). May be slightly botched but it looks fine.

Viewing 1 replies (of 1 total)
  • The topic ‘Horizontal menu with list images’ is closed to new replies.