next_post_link() + previous_post_link() (6 posts)

  1. echozone
    Posted 10 years ago #

    I had seen when the development had made this change:

    "next_post() and previous_post() are deprecated in favor of next_post_link() and previous_post_link()"

    These new tags are used in the updated default template, but the codex does not yet have this documented.

    Before I upgrade, I would like to check if next_post_link() and previous_post_link() actually do work in limiting to the current category, + also are there any configurable parameters (they show '«Â %link' -and- '%link »'). I especially want to configure the string to read a generic "Next Entry" rather than the post title.

    Can anyone report how these are working to constrain to same category + how they appear. Thanks!

  2. Dgold
    Posted 10 years ago #

    I also noticed next_post_link is not in the Codex that I can find. Is there any more info posted about it? I'm new at modifying my template, but finally getting down to wanting to change the Post template. These tags are used in the Default Template based on Kubrick.

    I have the same question as previous post -- how to display generic "NEXT POST" instead of post-titles.

    EDIT: I will probably find answers in other threads I'm finding via search like http://wordpress.org/support/topic/34939

  3. notthatugly
    Posted 9 years ago #

    Codex still hasn't documented these functions, and previous_post/next_post are still in there with no suggestion that they're deprecated.

    So can I take it that developers have changed their minds on this and I'm OK to use previous_post instead? Or would I be better off delving into the functions file to find which parameters are taken by previous_post_link?

    (I suppose I should do the latter anyway and document my findings on Codex for the benefit of the community, but theme competition deadline is in a week's time so I'd prefer to minimise the detective work right now.)

  4. Kafkaesqui

    Posted 9 years ago #

    They (next/previous_post) are still marked as deprecated, so it'd be smarter to go with the next/previous_post_link tags (both in the current release pass off to get_next/previous_post() to get the link in any case, as they are the behind the scenes workhorse for this now).

    I'm not sure how these got missed in the last big hit on the template tags done on Codex, but I'll mark them on my todo list (should probably revisit all the tag docs...yeah boy...).

  5. notthatugly
    Posted 9 years ago #

    Will do, thanks for the quick reply!

  6. ksar
    Posted 9 years ago #

    You can have a look here and get all information you need
    You have to write this to display [Previous Post:URL]:
    previous_post_link('« %link', 'Previous post')
    I hope it could help you.

Topic Closed

This topic has been closed to new replies.

About this Topic