WordPress.org

Ready to get started?Download WordPress

Forums

Navigation Issue (5 posts)

  1. es
    Member
    Posted 9 years ago #

    I've searched and maybe I've missed it but here is my issue if someone might be able to point me in the right direction.

    When going to an archived post the next post title and the previous post title link are shown at the top aligned to the left and right. Is it possible to create a link to the main page centered between the two? The code that is in use at this point is (I think):

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','« Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries »','') ?></div>
    </div>

    Any help would be appreciated...

    Thanks...

    e.s. - The Examined Life http://www.estephens.org

  2. moshu
    Member
    Posted 9 years ago #

    You could use something like
    <a href="<?php bloginfo('url'); ?>">Home</a>
    probably in another div that's centered?

  3. Anonymous
    Unregistered
    Posted 9 years ago #

    You could use this.
    Mine is at the top of my page, hence the post div showing here:

    <?php if ($single) { ?>
    <div class="cent">
    <?php previous_post('%', '', 'yes', 'no', 1, '') ?>
    > >
    ||
    <a href="http://www.example.com" title="Home">Home</a>
    ||
    < <
    <?php next_post('%', '', 'yes', 'no', 1, '') ?>
    <br />
    <br />
    </div>
    <?php } ?>

    <div class="post">

    This works in 1.5

  4. moshu
    Member
    Posted 9 years ago #

    Note. If you have a single.php template you won't need the if_single statement.

  5. Kafkaesqui

    Posted 9 years ago #

    Set it up like this in your template:

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?></div>
    <div class="aligncenter"><a href="<?php bloginfo('home'); ?>">home</a></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?></div>
    </div>

    Then in your css:

    .alignright {
    width: 33%;
    float: left;
    text-align: left;
    padding-bottom: 10px;
    }
    .aligncenter {
    width: 34%;
    float: left;
    text-align: center;
    padding-bottom: 10px;
    }
    .alignleft {
    width: 33%;
    float: left;
    text-align: right;
    padding-bottom: 10px;
    }

    Your navigation class would probably need to have a width property of 100%.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.