• Resolved catalpha

    (@catalpha)


    How can I modify:

    <?php previous_post_link('« %link') ?> | <?php next_post_link('%link »') ?>

    in single.php to NOT display the post title as a link, but something like “next” or “previous” instead?

    All code for single.php:

    [code removed as per forum rules - please use the pastebin]

Viewing 1 replies (of 1 total)
  • Refer to the Codex entry for previous_post_link().

    previous_post_link( $format, $link, $in_same_cat, $exclude_categories ) accepts four arguments:
    – $format: string format of the link, using the %link% placeholder for the HTML link. Default: “%link% »”
    – $link: text (string) to display within the HTML link. Default: “%title%” (Post Title)
    – $in_same_cat: boolean (TRUE/FALSE) value to specify if linked post must be in the same category as the
    current post. Default: FALSE
    – $exclude_categories: list of categories by ID, separated by ‘and’, to exclude. Default: none.

    So, to display “Previous”, rather than the Post Title, change the second argument to “Previous”, rather than “%title%”

Viewing 1 replies (of 1 total)
  • The topic ‘Single Post previous and next links’ is closed to new replies.