[wp-trac] [WordPress Trac] #17808: Using only custom post types results in 404 on RSS feeds

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 15 10:34:45 UTC 2011


#17808: Using only custom post types results in 404 on RSS feeds
--------------------------+----------------------
 Reporter:  heilhard      |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Feeds         |     Version:  3.1.3
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+----------------------
Changes (by dd32):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Looking at the output, I believe !WordPress is doing as you're asking. In
 adding the rule yourself, what !WordPress is doing on that page load, is
 querying for the home page, since there is nothing on the front page, it's
 404'ing. The fact your custom files then output something is ignored as
 !WordPress expects your themes 404 page is being served.

 The flow for that iscurrently:
  1. Parse request, it's a index hit, it's not a feed (as it's not
 registered via add_feed())
  2. Query for Home page posts, Find none, throw a 404, let the themes 404
 be served
  3. Theme kicks in, some code which calls create_newsfeed() is run (not
 included in your example)
  4. WP_Query call is made and a Query is made for the custom post type,
 It's not the main request, so headers are not set.
  5. Theme is output with the 404 from step 2, WordPress believes your
 serving a 404 page.

 Quick suggestions:
  * use your custom rules and Hook parse_request, and set your request
 there (instead of using new WP_Query
  * use add_feed() and hook parse_request and set your request, hope it
 works..
  * Use your code as is with double queries, and call status_header(200);
 in your custom newsfeed..

 Either way, This isn't a core bug, it's a common fault of "Doing things
 too late" ie. after the WordPress queries have already run. If you need
 any further details, please use a support avenue such as the wp-hackers
 mailinglist or the Support forums.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17808#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list