WordPress.org

Ready to get started?Download WordPress

Forums

Post Type: Query post by Taxonomy (1 post)

  1. RandallFlagg
    Member
    Posted 3 years ago #

    Hello to all.
    I have a website that's for a movie theater and as It have lots of movies coming and going, I end up using Post Types and Taxonomies, of course.
    I have inside my post type "peliculas" ("movies" in english) a taxonomy called "fecha de estreno" ("release date" in english).

    Then I have a category called "Proximos Estrenos" ("Next Releases"), and what I've been meaning to do is to sort my Next Releases by Release Date.
    So, let's say that "Salt" premiers tomorrow, "Lord of the Rings" in november and "Harry Potter" in december.

    I want to my query post to show my the posts in this order:
    1 => Salt
    2 => Lord of the rings
    3 => Harry Potter
    "Salt" is first because is the one that premiers tomorrow, and so on.

    Now, the thing is that I have the date in my taxonomy, which by the way is plain text and is not in a date form, and I want to sort my post by this taxonomy.
    The thing is that I have idea of how to do this.

    A query post won't work cause, as far as I understand, there isn't a way to search taxonomys and the "orderby" has no parameters for this.
    If someone can help me out with this?

    I don't want to end up usin "custom fields", 'cause they aren't easy to use to the final user.
    Thanks in advance for everything!

Topic Closed

This topic has been closed to new replies.

About this Topic