Forums

Links (4 posts)

  1. xychromosome
    Member
    Posted 2 years ago #

    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.

  2. deanhatescoffee
    Member
    Posted 2 years ago #

    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.

  3. deanhatescoffee
    Member
    Posted 2 years ago #

    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.

  4. xychromosome
    Member
    Posted 2 years ago #

    Thanks guys!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.