acoburn4
Forum Replies Created
-
I believe it’s broken b/c of your CSS. I looked at your page https://www.booooooom.com/blog/jeff/ and I could not find the class .cat-item-8227 that you are targeting in your style.css
Hope that helps!
hi happypelican-
In order to exclude a category from my main blog page and RSS feed, but not the category’s specific RSS feed I follow this 2-step process:
1. Exclude category from main blog page (loop.php)
A. Open up your theme’s loop.php
B. Insert the following PHP code at the top of the file: https://pastebin.com/k4y4Jwxt
C. Replace numbers with the id’s of the category you want to exclude (In order to find the ID number, go to your list of categories in WP dashboard, and hover over the one you want to exclude. The URL will contain the ID number of the category. For example, the ID number of this URL is 123: https://www.yourwebsite.com/wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=123&post_type=post.)
D. Save file and check main page to be sure category is excluded2. Exclude category from main RSS feed but not category’s RSS feed
A. Open your theme’s functions.php file
B. Insert the following code: https://pastebin.com/QNT6Qhn0
C. Replace excluded-category-slug1 with the name of your slug (In order to find the name of your slug, go to your list of categories in WP dashboard, and find the slug column of the category you want to exclude).
D. Save file and check main RSS feed to be sure category is excluded: https://www.yourwebsite.com/feed
Check category RSS feed to be sure posts still show: https://www.yourwebsite.com/category/slug-goes-here/feedI realize I am filtering by ID for the first step and by slug name for the second. These should probably be consistent and use the same parameter. If anyone wants to clean it up, feel free. I’ve had no reason to b/c it’s been working great for me. Hope this helps someone else!
Hi All,
Finally! I got the main RSS feed to exclude categories (https://www.yourwebsite.com/feed), but these posts still show up on their category-specific RSS feed (https://www.yourwebsite.com/category/your-category-name/feed)I did not use the Ultimate Category Excluder module to accomplish this. I modified someone else’s code and put it in my theme’s functions.php file.
Here is the code I used for my site:
[Code moderated as per the Forum Rules. Please use the pastebin]
The only thing you need to modify for your own site are the ‘replace-your-category-name’. Replace it with the slug of the category you want to exclude.
Hope this helps someone out!!Source: (https://www.simonwheatley.co.uk/2011/01/05/excluding-one-category-from-the-main-wordpress-feed/)
Is it possible to exclude categories from the main blog page and the main RSS feed, but keep the category RSS feeds intact?
I am also looking for a solution to this problem.
I was hoping instead of using a plug-in to put some more logic on this PHP statement:
function myFeedExcluder($query) { if ($query->is_feed || $query->is_home ) { $query->set('cat', '-455, -462'); } return $query; } add_filter('pre_get_posts', 'myFeedExcluder');
I will post a solution as soon as I figure it out.