Thread Starter
bmck
(@bmck)
Obviously a difficult question.
Thread Starter
bmck
(@bmck)
Evidently extremely challenging. I’ll bet there isn’t a single WP user visiting these forums who is remotely capable of answering this one, with a simple “Yes” or “No, it isn’t possible”. Not the case? Prove me wrong!
Thread Starter
bmck
(@bmck)
I’ve given up on changing index.php. I’ve reverted to the default. Here’s the current situation:
http://www.bioneural.net/feed/ will redirect correctly to FeedBurner (http://feeds.feedburner.com/Bioneuralnet).
I want http://www.bioneural.net/9rules/feed/ to re-direct to a custom feed that excludes posts in category 16.
I added the following to my .htaccess file:
# Test to show bookmarks only
RewriteBase /
RewriteRule ^9rules/feed/?$ /index.php?&feed=rss2&cat=16 [R,L]
This will correctly show cat 16 (bookmarks) only for http://www.bioneural.net/9rules/feed/
# Create a feed for 9rules.com excluding bookmarks
RewriteBase /
RewriteRule ^9rules/feed/?$ /index.php?&feed=rss2&cat=-16 [R,L]
This should show posts in all categories *except* in cat 16.
However, it results in this:
WordPress database error: [Not unique table/alias: ‘wp_post2cat’]
SELECT DISTINCT * FROM wp_posts LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) WHERE 1=1 AND (category_id != 16) AND post_date_gmt <= ‘2006-07-20 10:10:59’ AND (post_status = “publish” OR post_author = 1 AND post_status != ‘draft’ AND post_status != ‘static’) AND post_status != “attachment” GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 10
Warning: Cannot modify header information – headers already sent by (output started at /home/.ashea/bioneural/bioneural.net/wp-includes/wp-db.php:102) in /home/.ashea/bioneural/bioneural.net/wp-rss2.php on line 8
http://www.bioneural.net stuff worth sharing Tue, 18 Jul 2006 21:09:04 +0000 http://ww.wp.xz.cn/?v=2.0.3 en
Anyone?
Thread Starter
bmck
(@bmck)
OK, so I’m told this rewrite hack worked in WP 1.x but broke in WP 2.x
I don’t think you’re on the wrong track here. I didn’t know that the -cat trick would work for feeds, but it does on my blog, so it should on yours too.
Try this URL: http://www.bioneural.net/index.php?feed=rss2&cat=-16
If that doesn’t work, I suspect that your feed redirection to feedburner is the real problem here.
Thread Starter
bmck
(@bmck)
Otto42 thanks, no, I already tried that URL and I get the same WP database error as above. You may be right about implicating the FeedBurner redirection (which I want to keep). In any case I have finally resolved this and now offer a excerpt-only feed for all categories, and a full-text feed excluding category 16 (bookmarks).
Details here.
This thread looks really promising, but I’m a little lost. I am trying to exclude 2 categories from my feed.
Would I just write this to exclude the categories?
$cat=-8,-14;
Where exactly would I add that?
Thread Starter
bmck
(@bmck)
your.site.com/index.php?feed=rss2&cat=-8,-14 as the URL might work. Maybe it depends on which version of WordPress you use. Maybe on whether your redirect to FeedBurner. Maybe on the phase of the Moon?
Right, I could do that… but I want the default feed to omit these categories instead. I want people to visit your.site.com/index.php?feed=rss2 directly and not find these 2 categories… is this possible? I don’t want people to have to add stuff to the end of the URL…
Thread Starter
bmck
(@bmck)
Can you edit your .htaccess file? If so this might work:
# Re-direct default feed to exclude cats 8 and 14
RewriteBase /
RewriteRule ^feed/?$ /index.php?&feed=rss2&cat=-8,-14 [R,L]
So anyone who clicks on your default feed link (http://your.site.com/feed/) should get re-directed to:
http://your.site.com/index.php?feed=rss2&cat=-8,-14
Please let me know if this does work. If so, then the reason it does NOT work for me must be to do with my FeedBurner re-direction.
For future reference, I was able to exclude a category while still using FeedBurner. I just edited the FeedBurner source feed to be:
http://your.site.com/index.php?feed=rss2&cat=-N
(where N is the category number to exclude)
It’s looking good so far. If I run into any problems, I’ll post back here.
I’m trying to do this same thing. Did the final solution work?