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)
-   -   Wordpress category question (https://gfy.com/showthread.php?t=1056294)

MyDogHasFleas 02-04-2012 11:25 PM

Wordpress category question
 
Is there a way to make a post show up only in the category page and not on the main page? For example I want to add some gay posts to my blog... but I only want them accessible from the gay category. Is this possible?

harvey 02-04-2012 11:33 PM

of course, just open your index page, look for the query and add

Code:

'&cat=-15'
where 15 is your "gay" category.

If you want to exclude it ONLY in main page but not in archives, do as follows:

Code:


<?php if ( is_home() )
{
query_posts($query_string . '&cat=-15, -20');
}
?>

where, again, 15 is your gay category and 20 is your tranny category, assuming you need to exclude more than 1 cat. Replace with your real category IDs, obviously

fris 02-05-2012 03:18 PM

or for the less wp friendly crowd theirs a nice plugin, i think advanced category exclude, which will work without touching any code.


All times are GMT -7. The time now is 11:40 AM.

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