How to exclude one category from main page?

General questions pertaining to how certain issues can be resolved. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.

1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"
Locked
WimScholtes
Posts: 51
Joined: 28 Oct 2009, 14:23

How to exclude one category from main page?

Post by WimScholtes » 22 Dec 2009, 08:21

On the main page of my blog (http://www.ischoltes.nl) all postings are showed. However I want to exclude one category from showing on this main page but I can't discover how to achieve this. I supposed that there must be a setting where I can include the categories shown on the main page but I can't find it. May be that's because it doesn't exist :?:.

I experimented somewhat with the featured posts and a static page and the magazine template but that's not what I want. I just want some control about what is shown a what's not on the main page.

Solutions are welcome ;).

Greetings...
Wim

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: How to exclude one category from main page?

Post by sayontan » 22 Dec 2009, 10:49

Wim,
There is no solution for this in the theme. If you want to implement this you have to write your own code, because this is a non-standard requirement (meaning there is almost no chance that I will build it). The right place to do this would be in index.php. Look for the line:

Code: Select all

	<?php if (have_posts()) : ?>
Before that put in:

Code: Select all

query_posts('cat=-4');
Replace 4 with your category id. Remember to put the "-" before the category id, because that will tell the code to exclude this category.

Sayontan.

PS: On an unrelated topic - can you take a crack at resubmitting the Dutch translation, please? A lot of things have been added in the last few weeks, making the translation somewhat out of date.

WimScholtes
Posts: 51
Joined: 28 Oct 2009, 14:23

Re: How to exclude one category from main page?

Post by WimScholtes » 23 Dec 2009, 02:06

Sayontan,

Thanks for this insight in WordPress. Off course I'm very disappointed that I have to change the code myself :lol: and that neither WordPress nor some very intelligent and experienced programmer can deliver this ;) .

Greetings...
Wim

PS: on/off topic, ofcourse I will update the Dutch translation. Did not realize that it changed with the new versions off the theme (off course it does but I think I get a bit lazy/old/slow :roll: ). Will send it probably today (my day that is).

WimScholtes
Posts: 51
Joined: 28 Oct 2009, 14:23

Re: How to exclude one category from main page?

Post by WimScholtes » 24 Dec 2009, 04:36

PS I don't like changing the core code because with an update of WP it will probably disappear and I have to do it again etc. So I did an search on WordPress again and found that I'm not the only one who wants this feature. Even better, some people did write a plugin to do this exclusion of an category on the main page (and much more). So I added the "Advanced Category Excluder" plugin and now got the functionality that I want.

Problem solved, me happy ;) .

smartyd
Posts: 32
Joined: 04 Nov 2010, 19:29

Re: How to exclude one category from main page?

Post by smartyd » 25 May 2011, 13:44

I tried this on my blog (http://www.diypics.com) but it doesn't work. I tried it both in the index.php and in the layout-tile.php, but no matter which category I chose, all of them show up. I'm using a child theme and inserting it in there. What am I doing wrong?
Thanks

WimScholtes
Posts: 51
Joined: 28 Oct 2009, 14:23

Re: How to exclude one category from main page?

Post by WimScholtes » 25 May 2011, 13:56

It's been a while since I had that problem. I'm not sure but if I remember correctly, I had some problems with that explicit plugin and an update of WordPress. Since then (at least now) I use the plugin "Simply Exclude" and it works fine.

Greetings...
Wim

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: How to exclude one category from main page?

Post by sayontan » 25 May 2011, 13:58

Thanks for responding, Wim.

Too bad you moved to Platform :-(

smartyd
Posts: 32
Joined: 04 Nov 2010, 19:29

Re: How to exclude one category from main page?

Post by smartyd » 25 May 2011, 15:49

The plugin worked. Thanks!

WimScholtes
Posts: 51
Joined: 28 Oct 2009, 14:23

Re: How to exclude one category from main page?

Post by WimScholtes » 26 May 2011, 09:44

sayontan wrote:Too bad you moved to Platform :-(
Dont worry ;) Once in a while I feel the need to try 'something completely new' (to me) but after a while I probably will return to Suffusion again. Time will learn...

Greetings...
Wim

PS I still follow your progression, keep on going :P

Locked