• I have a custom post_type that is associated with a specific week of the year. This post type is always ordered by that ‘week’ custom post meta value, so that every year, the content effectively repeats itself (but is not re-published, but kept sorted so current week is “most recent” when it is queried). Now, we also have recently started a blog category that contains supplemental posts that reference and add information to that weekly custom post_type. What we would like to do is, whenever a user is viewing that blog category, that the custom post_type is injected at the beginning of the appropriate week, so when viewing the category archive page, the supplemental posts are ordered by their date, but any of the custom post_types are appropriately inserted at the beginning of the week they are set to display on.

    i.e. — in a post list (assuming Sunday is the first day of the week)

    * A Recent Supplement Post (published Sept. 8, 2015)
    * Custom post_type Post (Week 37)
    * A Recent Supplement Post (published Sept. 4, 2015)
    * A Recent Supplement Post (published Sept. 1, 2015)
    * Custom post_type Post (Week 36)
    * A Recent Supplement Post (published Aug. 28, 2015)
    * A Recent Supplement Post (published Aug. 26, 2015)
    * A Recent Supplement Post (published Aug. 24, 2015)
    * Custom post_type Post (Week 36)

    Etc.

    I’ve tried a few custom query_posts attempts, and even trying to merge two arrays returned from query_posts or WP_Query, without much luck.

    Any ideas?

  • The topic ‘Injecting Custom Post Types within Category query’ is closed to new replies.