WordPress.org

Ready to get started?Download WordPress

Forums

Create a Navigation "loop" by generating the URL (1 post)

  1. offed
    Member
    Posted 2 years ago #

    I'm trying to create a navigation where the last post links to the first post in my portfolio site so that there is a continuous loop.

    I had some success with the Loop Post Navigation plugin, but the problem is I can't get the plugin to generate only a URL.

    Here's the closest I've gotten so far to using URLs. Of course this isn't looped
    :

    <?php
    $prev = get_permalink(get_adjacent_post(false,'',false));
    $next = get_permalink(get_adjacent_post(false,'',true));
    ?> 
    
    <div id="navarrows"></div>
    	<a class="navLink" href="<?php echo $prev; ?>">
    		<div class="left column"> <div id="leftcol"> <p>back</p> </div> </div></a>
    	<a class="navLink" href="<?php echo $next; ?>">
    		<div class="right column"> <div id="rightcol"> <p>next</p> </div> </div></a>

Topic Closed

This topic has been closed to new replies.

About this Topic