• Resolved Emil K

    (@ghostspirit)


    Hi there! Thank you for creating an absolutely amazing plugin! So far it’s been a breeze, but I’ve hit a wall in trying to get my custom layout to sort by taxonomy field.

    I’m working on building a “week overview” for classes, and would like to sort based on the ‘time of day’ taxonomy.

    I can see that I can sort the layouts by:
    – Post Title
    – Published Date
    – Modified Date
    – Post ID
    – Comment Count
    – Author

    Is it possible to sort by a specific taxonomy field value (in my case values like “14:00” and “19:00” for a product attribute)?

    • This topic was modified 3 years, 1 month ago by Emil K.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Code Amp

    (@codeamp)

    Hey @ghostspirit

    I’m afraid I don’t think there is a way to sort using a taxonomy in this way… Taxonomies can’t usually be used for advanced sorting (or numerical sorting, more specifically)…

    What I would recommend is that you store the start time (if that’s all you need), as a custom field (you can create custom fields with a free plugin called ACF, or it can be done via wordpress admin directly)..

    This means is can be sorted in our layout, but, not without some code being added to your site.

    This is because we don’t provide a sort by “custom field” option in our admin area, but it can be added using our filter: custom-layouts/layout/query_args

    https://customlayouts.com/documentation/action-filter-reference/

    Happy to help advise on the code part once you get that far.

    Please let me know how you get on.

    All the best

    Plugin Author Code Amp

    (@codeamp)

    Hey @ghostspirit

    I’m closing this for now as its been a week since your last message – please re-open if you want to continue this discussion.

    Best

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sort layout by taxonomy value’ is closed to new replies.