Forums Forums Search & Filter Pro Getting Page Not Found on ALL search/Filter attempts plus AJAX not working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #2680

    Not sure what I am missing, but each time I try to filter or search, I am taken to a page not found. Here is the link to where the form is: http://craftsmensguildofms.org/members/

    Also…in the sort by…I was wanting to sort by ASC or DESC by the artist name. I’m using Advanced Custom Fields to create the custom fields. The name of the artist is the “Title”. Not sure where how to set the order by for that?

    One more thing…AJAX is not working either for the search results so tried to disable. But…still getting the page not found.

    Would be more than happen to give WP credentials if that would help.

    Anonymous
    #2681

    Crap..I had the wrong checkbox on the rightside selected. Search Results are now working with the filtering. Still having a problem with the AJAX and the sorting. And just to be clear on the sorting problem as I don’t think I explained correctly. The Post Type is “Members” and the name of the artist that I’m trying to sort by is one of the entries added to the post type of Members. Hopefully that makes sense:) Am trying to avoid having the client go back and add the Member name as a custom field instead of the title as they have already entered in over 370 entries.

    Ross Moderator
    #2706

    Hey Brent

    To set a default sort order try this in your functions.php:

    function order_results_default( $query )
    {
        global $sf_form_data;
    	global $wp_query;
    	
        if ( $sf_form_data->is_valid_form() && $query->is_main_query() && !is_admin())
        {
    		if(!isset($wp_query->query['sort_order']))
    		{
    			$query->set('orderby', 'title');
    			$query->set('order', 'DESC');
    		}
        }
    }
    add_action( 'pre_get_posts', 'order_results_default', 21 );

    🙂

    Anonymous
    #2751

    Great fix and incredible plugin! Thank you! Quick question..I remember seeing you saying not to put any queries, I think, before the loop as they would mess up what the plugin does. Any advice on how I can set the order by default, on page load, to order by title ASC?

    Ross Moderator
    #2783

    Hey Brent

    You can of course place custom code / queries before the main loop, however as with any regular WP template, in order for your custom query not to affect the main query, you must do something along the lines of resetting the main query back to the original one once you have finished processing:

    Take a look here:
    http://codex.wordpress.org/Function_Reference/wp_reset_query

    🙂

    Anonymous
    #3693

    Just a heads up…the code you gave me above to put into the Functions.php file has caused my site to completely crash each time I have upgraded your plugin to the latest version. Looking at the error log:
    [18-Aug-2014 16:16:14 UTC] PHP Fatal error: Call to a member function is_valid_form() on a non-object in /home4/craftso5/public_html/wp-content/themes/crafts/functions.php on line 580

    When I remove the code from the functions file…site has come back with no problems.

    Anonymous
    #3694

    Also…I’m still not 100% following how to add a simple order and orderby query without throwing off the main query. Following the link you provided…I can see the custom query and the area to put the loop…but if I go by that…it breaks the main query and no longer pulls the content I need. So just having a hard time figuring out where to put this query and also having the main loop still work.

    Ross Moderator
    #3728

    Hey Brent sorry been a bit busy here – do you want to send me over your login details via our contact form (http://www.designsandcode.com/contact/) and I’ll try to take a look tonight or tomorrow?

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)