• Resolved renenee

    (@renenee)


    I would love to be able to sort both ascending and descending by “Modified Date.” Does anyone have insight as to how that might work with this plugin?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author stepasyuk

    (@stepasyuk)

    Hello @renenee

    Thank you for using Filter Everything plugin.

    It is possible only if you are familiar with PHP and you can modify filtered WP_Query via the ‘wpc_filtered_query_end‘ hook that the plugin contains.

    Thread Starter renenee

    (@renenee)

    Thank you for your response.

    I’m attempting to use the information you’ve given me, and adapt it based on another post in this support thread, but I’m receiving a “Nothing Found” result on the page. Can you let me know where I’m going wrong?

    // Filter Everything sort by modified date
    do_action( 'wpc_filtered_query_end', $query );
    function wpb_custom_query( $query ) {
        if( $query->is_main_query() && ! is_admin() && $query->is_archive() ) {
        	$query->set( 'meta_key', 'modified' );
            $query->set( 'orderby', 'post_modified' );
            $query->set( 'order', 'ASC' );
        }
    }
    add_action( 'wpc_filtered_query_end', 'wpb_custom_query' );

    Much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sort by Modified Date’ is closed to new replies.