• Hello, I am trying to add a link area to my blog. It’s essentially the default template for 2.3 just slightly manipulated. But for the sake of the argument, it’s the default profile.

    So I am trying to come up with code so that link are centered above the blog entries/pages but below the header and look like this:

    Home | Example Link | About | Etc.

    Do you know how I’d go about accomplishing this? These links are also known as ‘pages’ in the widgets.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Just add something like this:

    <ul id="pages">
    <?php wp_list_pages('title_li=&depth=1&sort_column=menu_order'); ?>
    </ul>

    That will display your pages. Then you’ll need to modify the CSS so that #pages li doesn’t show a bulleted list (which is the default behavior). Add something like this to your stylesheet:

    #pages li {
    	border-left: 1px solid #666666;
    	border-right: 1px solid #666666;
    	display: inline;
    	padding: 0 5px;
    }

    That will add a 1px line on each side of each link/page.

    EDIT: Sorry, forgot part of the CSS. You’ll want to add something like this too:

    #pages {
    	float: left;
    	list-style: none;
    	margin: 3px 10px;
    	padding: 0 20px 15px 20px;
    	text-align: left;
    }

    That’s the code that actually tells the list to not be bulleted.

    Oh, as for where to add the PHP code – that would go in your header.php file, (probably) immediately after the header image. It depends on your theme, but you’re not going to break anything by adding it to the very end of header.php – just see how it looks from there.

    Thread Starter xychromosome

    (@xychromosome)

    Thanks guys!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Links’ is closed to new replies.