WP Next/Previous Posts Exclude Category(s)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Freedom6995
    Friends of Venus founder
    • Jul 2010
    • 1975

    #1

    Tech WP Next/Previous Posts Exclude Category(s)

    A little WP help would be appreciated with $excluded_terms in the next/previous posts link.

    I've looked at the Codex for next post links help and have been unable to make it work.

    I think I have the right file ( /wp-includes/link-template.php ) but at this stage I'm questioning everything...including my sanity lol.
  • HowlingWulf
    Confirmed User
    • Nov 2001
    • 1662

    #2
    First off, don't change WordPress core files. It will just get overwritten anyway next update.

    Instead, make the changes to your child theme's files so they won't be lost.

    Here's an example to show next post that's not in category ID 13.

    Code:
    <?php next_post_link( '%link', 'Next post', FALSE, '13' ); ?>
    WP Porn directory/review theme Maddos $35.

    webmaster AT howling-wulf.com

    Comment

    • Freedom6995
      Friends of Venus founder
      • Jul 2010
      • 1975

      #3
      Originally posted by HowlingWulf
      First off, don't change WordPress core files. It will just get overwritten anyway next update.

      Instead, make the changes to your child theme's files so they won't be lost.

      Here's an example to show next post that's not in category ID 13.

      Code:
      <?php next_post_link( '%link', 'Next post', FALSE, '13' ); ?>
      Thanks for your help. Not sure where my brain decided to vacation this morning, but it sure wasn't at work. lol Thanks again.

      Comment

      Working...