Home › Forums › Pro Version › Different "Order By" Sorting
- This topic has 10 replies, 2 voices, and was last updated 5 years, 7 months ago by
Masonry Guy.
- AuthorPosts
snikay
ParticipantHi,
i want to have a different “order by”. I want to have the wpeddit_order displayed. Is there something i can modify to do so?
Yes i know that i probably have to turn off updates for that and have to merch further updates on my own.. If there is no way to add something to my functions.php..?Masonry Guy
KeymasterHi Toby,
When you don’t select any order during our shortcode should use order set by wpeddit_order (thinking it sends auto order for custom query).
For this check, please use lite version. If it works there then you can continue to use Pro version. If it doesn’t please let me know. I will try.
Thanks
snikay
ParticipantHi!
Answering here now instead of replying your mail.
I already bought the Pro version because your Grid seems to be the only usefull one 😉
Now i tested again on a blank second WP installation. and you’re right, it is working! so i was right too..it used to work on my project but now it somehow stopped working. whatever i do and play around with the shortcode settings, i can’t get it to work again. now i’m starting to freak out a bit -.- but i really don’t know what i could have done that one installation is working fine – the other one not..snikay
ParticipantWhoops..okay forget that i said it is working on the test installation. it’s not :/
snikay
ParticipantIf i set “Order By default” it just does nothing and keeps listing the posts by date (new-to-old) – WP default. If i select “Order by none” it’s date backwards (old-to-new).
This is the code i put in my functions.php to get the WPeddit order to show up:
//code for changing the custom post order function wpeddit_order($query) { global $wp_query; if ( ! $query->is_main_query() ) return $query; if(!is_page() || !is_admin()){ if(is_main_query()){ $query->set('meta_key', 'epicredrank'); $query->set('orderby', 'meta_value_num'); $query->set('order', 'DESC'); } } return $query; } add_action('pre_get_posts','wpeddit_order');
snikay
ParticipantSorry for spaming..your edit-button doesn’t work porperly..
the author of WPeddit said, that if the listing isn’t showing properly, the “theme” – or in our case your plugin – “is doing something to the wp_query. So maybe around there would be a hook?
Masonry Guy
KeymasterHi Snikay,
We use query_posts for our custom query. So pre_get_posts hooks doesn’t work there. So we need to write custom query for it.
If you can give me your wp-admin access, i can customize our plugin for you to accept this order.
Thanks
snikay
ParticipantThis would be great!
Oh, also maybe i should let you know that i wan’t to to use your Grid on different pages. So on one page i want to have the WPeddit order, on another page i want to have it shown by date (just as your plugin already offers).
Maybe you can build me just a new field for the “order by”-dropdown?Masonry Guy
KeymasterHi Snikay,
For now, we can’t have different order for each page. We can only follow 1 order now. Are you fine with it ?
We are thinking to add custom field order for upcoming version.
Thanks
snikay
ParticipantHi,
yeah thanks, that would be a solution for now. i really appreciate your effort and hope for a custom field order for the upcoming version. would be really great.would it work if i make a copy of the plugin to use it as a “second grid”?
If not, i would stick to your solution for now!
Masonry Guy
KeymasterHi Snikay,
Making copy is going to be tough task.
Thanks
- AuthorPosts