WordPress.org

Forums

Order by 3 values? (3 posts)

  1. cromermusic
    Member
    Posted 1 year ago #

    I have "the_title" which is the original post title and then I have about 9 custom fields using Advanced Custom Fields where of 2 I want to use for order/sorting and they are called "sorting"(text) and the other "year"(date).
    What I wan't to do is do is first sort by [sorting] alphabetically, then by [year] and last by [the_title] alphabetically.

    I use a category for all my posts with ID=1

    How can this be done?

    WP_Query something something??

  2. graphical_force
    Member
    Posted 1 year ago #

    What do you mean by sorting by alphabetically, then by year, then by title (alphabetically)?

    So you are wanting this on one query correct? If so, then only one alphabetical sort is needed since the other one does not make any sense that I can see. Let us know how that works.

    Any yes it would be done by using WP_Query.

  3. cromermusic
    Member
    Posted 1 year ago #

    No, that would make it a mess I'm afraid.
    The project I'm working on is a site for my record collection. Minor CSS stuff to fix but other than that the site is done except the index site over my record collection.
    So "sorting" is the artist name, "year" the date of the release for the record and "title" the title of the album.

    First sort artist, then all the albums by that artist in chronological order and if there are more than 1 record with the same artist sharing the same year then sort those alphabetically.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.