GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tech WP Next/Previous Posts Exclude Category(s) (https://gfy.com/showthread.php?t=1168756)

Freedom6995 06-20-2015 03:37 AM

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 06-20-2015 09:29 AM

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' ); ?>

Freedom6995 06-20-2015 03:29 PM

Quote:

Originally Posted by HowlingWulf (Post 20503457)
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. :thumbsup


All times are GMT -7. The time now is 01:03 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc