WordPress.org

Ready to get started?Download WordPress

Forums

An alternattive way to get links to the next and previous post? (4 posts)

  1. SpyderFCS
    Member
    Posted 8 years ago #

    I'm working on a photoblog and I have pretty much everything I need set up except the previous and next navigation. I don't want just previous and next links but am rather going to use some image mapping to link to the previous page.

    I'm shooting for the type of effect that can be found here: http://www.huddletogether.com/gallery/japan/index.php?id=2

    I got the image map all set up but can't figure out how to get the url's for the next and previous page automatically. The posts_nav_link won't work and neither will the previous_post tag because I'm trying to do this on the index.php in addition to the individual posts.

    Any ideas?

  2. Kafkaesqui

    Posted 8 years ago #

    Check out my plugin here and see if it does what you need:

    http://wordpress.org/support/topic/51091#post-282019

    Note that, like the regular next/previous_post template tags, this does not work anywhere but on single post queries. But you can trick WordPress to display them anywhere by using $wp_query->is_single like so:

    <?php $wp_query->is_single = true; next_post_url(); $wp_query->is_single = false; ?>

  3. SpyderFCS
    Member
    Posted 8 years ago #

    That seems like it might do what I want it to do. Thanks...but I keep getting this error when trying to activate the plugin:

    Warning: Cannot modify header information - headers already sent by (output started at /home/.unger/spyderfcs/f1period8.com/wordpress/wp-content/plugins/post_nav_url.php:60) in /home/.unger/spyderfcs/f1period8.com/wordpress/wp-admin/plugins.php on line 16

  4. Kafkaesqui

    Posted 8 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags