123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|685|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Web Development -> wordpress query trouble :(

Wed, 20 Feb 2013, 03:09
spinal
Here's one of those 'spinal not noes php' problems that googling just cant seem to fix.

I have a wordpress site set up, all posts having a rating. I am trying to cross reference the posts across two categories and show the results, the following will do that no problem...



The trouble comes when I try to order these posts, nothing happens, absolutely nothing.

To order them without the query (showing all posts) the following will work fine



However, trying to add that to the query, results in nothing getting sorted at all.



Can anyone help?

-=-=-
Check out my excellent homepage!
Wed, 20 Feb 2013, 04:31
CodersRule
edit: Checked WordPress source, and this suggestion will not do anything. Strings and Arrays end up being treated the same way.

Try simplifying the query until you get something that works. Query just a single category, or perhaps remove the 'paged' variable.

/* I can't recommend you use it in production, but what happens if you do what they love to do in the WordPress docs and just throw it into a concatenated string? It might not be pretty, but if it works you can diagnose the problem from there.

Also, are you SURE that passing an array makes WordPress sanitise it? Otherwise, there's an injection vulnerability in your $cats and $styles variables. */
Wed, 20 Feb 2013, 04:44
spinal
I've got a little further...

found a function to grab the categories from the url (the correct way) so my url can now be something like https://mywebsite/subpage/?cat=10+14

Now I just need to grap the 10+14 and reinsert them when linking the &order=asc

-=-=-
Check out my excellent homepage!