WordPress.org

Forums

3.0 Incorrect template loading for index.php?post_type=custom_post_type (1 post)

  1. Aaron Harun
    Member
    Posted 5 years ago #

    Problem:

    Right now, if you add a custom post_type and add a rewrite to handle it, even if posts are found, WordPress sets the is_home parameter.

    To test this, I've written a plugin that demonstrates the failure.

    http://pastebin.com/2WRTVzFu (Not the exact code I am using.)

    Expectation:

    If WordPress functioned as expected, going to site.tld/project/ would show an archive-like page the same as site.tld/category/project/ would if it were an archive. However, $wp_query->is_home is set to 1 and continues loading ignoring the posts.

    Solution:

    Queries for post_type are clearly not the same as a is_home query. A search for post_type by itself should return is_archive = 1.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.