adapt shortcode to sort on custom data?
-
Hello,
I would like to sort my articles according to personalized data (3 fields that have been added via a script),
I see them well (in the admin dashboard) when I consult my articles (3 new columns are clearly visible for each article).
I was able to enter data (via custom Fields) in edit mode for all items.I installed the “Search and Filter” plugin (free version), so I got the example of the following shortcode for the sorting part:
[searchandfilter fields=”search,category,post_tag” order_dir=”,asc,desc” order_by=”,id,name” types=”,checkbox,radio” headings=”,Categories,Tags”]
that I adapted by adding my new sorting field (number_runners) but it never takes it into account, I’m not sure if I should leave the headings and tags at the end??.
[searchandfilter fields=”search,category,post_tag” order_dir=”asc” order_by=”number_runners” types=”radio” headings=”Tags”]
when I view the page, it offers me a drop-down list with the categories and a submit button but when I execute:
the sort order always remains the same, always the default one (by date of creation of articles)
so it never takes into account the “order by number_runners” (I had to crash on the adaptation of the shortcode!! not easy:-0!)
(and is there a way then to display this data in the drop-down list because I actually have 3 fields, 3 sorting criteria)??
Thanks a lot! because I have a lot of trouble with it!! :-((
- The topic ‘adapt shortcode to sort on custom data?’ is closed to new replies.