Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Jonathan Davies
Jonathan Davies
2,162 Points

nav_posts_link

I have a slight problem with my nav_posts_link. It all works and it does what i need it to do however. When i surround it in a container div to make it look like it sitting on a bar, the nav_posts_link show up after my list of posts but the bar containing the nav_posts_link is floating at the top of the page.

            <div class="post-nav">

            <div class="older">
                <?php next_posts_link(' &larr; Older Posts '); ?>
            </div>
            <div class="newer">
                <?php previous_posts_link(' Newest Posts &rarr; '); ?>
            </div>

            </div>

1 Answer

Jonathan Davies
Jonathan Davies
2,162 Points

Solved this with some CSS by using clear:both on the post-nav. Couldn't believe it was that simple. Also found a really useful piece of code that Zac posted at someone who had a similar problem to do with pagination.

http://css-tricks.com/snippets/wordpress/paginate-custom-post-types/