Topic: Different "Order By" Sorting | WP Masonry Layout

Different "Order By" Sorting

Home Forums Pro Version Different "Order By" Sorting

This topic contains 10 replies, has 2 voices, and was last updated by  Masonry Guy 1 year, 7 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #5641 Reply

    snikay
    Participant

    Hi,
    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..?

    #5643 Reply

    Masonry Guy
    Keymaster

    Hi 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

    #5653 Reply

    snikay
    Participant

    Hi!
    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..

    #5654 Reply

    snikay
    Participant

    Whoops..okay forget that i said it is working on the test installation. it’s not :/

    #5655 Reply

    snikay
    Participant

    If 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');
    
    #5656 Reply

    snikay
    Participant

    Sorry 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?

    #5662 Reply

    Masonry Guy
    Keymaster

    Hi 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

    #5665 Reply

    snikay
    Participant

    This 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?

    #5681 Reply

    Masonry Guy
    Keymaster

    Hi 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

    #5682 Reply

    snikay
    Participant

    Hi,
    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!

    #5685 Reply

    Masonry Guy
    Keymaster

    Hi Snikay,

    Making copy is going to be tough task.

    Thanks

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: Different "Order By" Sorting
Your information: