• Resolved bluetideproductions

    (@bluetideproductions)


    I am trying to do a custom sorting function for a theme.

    I already have the ability built to sort by title, number of comments, a few custom fields, etc. (that is all built in WP), which is the easy part.

    What I want to be able to do is sort by a jQuery var that is NOT a custom field or anything. I have a “voting sytem” made for each post (on the category page) & each post has a unique voting system. Well using jQuery I can target the number of votes the post has by finding the “span” that displays the number. So basically, I have got to the point where I have pulled just the number as a var.

    Well, where I am stuck is, is it possible to use that var to do a custom “orderby” query in WP based only off that var, which is NOT a custom field or anything inside the post meta?

    Please Let me know if this is not 100% clear on what I mean or I am trying to do and I can try to further explain! Thanks! ??

    NOTE : I already have built in ASC and DESC as well.

    My testing page is: https://shirtlaunch.com/category/testing123/ you can see how I already have the dynamic sorting in, currently. (I haven’t formatted it all yet)

  • The topic ‘Custom Query by jQuery Var’ is closed to new replies.