This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 15 posts - 3,751 through 3,765 (of 18,427 total)
  • Author
    Posts
  • in reply to: Frontend does look like preview #44450
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Before I start I need to inform you that I can’t promise anything as this falls way above the customization category and that is not officially part of our support. That being said I will of course try my best to get around this.

    The code seems great to me, after the asp_results hook the plugin only executes a final results grouping function, but only if the results grouping feature is enabled, but in your case it is not. The order is not changed by the plugin afterwards.

    In your code you do an array_multisort, however it does not seem correct to me, and also the $results array also contains the original results, it is not reset.
    In your case the array_multisort will sort the $results array (it will basically do nothing I believe), and then will try to sort the $scores array too with the same ordering as the $results array. So it’s not doing what you think it’s doing.

    Instead of that, add the score to one of the results attributes like so:

    $result->score = $strpos_score !== false ? $strpos_score : INF, $levenshtein_score;

    Then do a usort:

    usort($results, function($a, $b){
    	if ( isset($a->score, $b->score) ) {
    		if ( $a->score == $b->score ) {
    			return 0;
    		}
    		return $a->score > $b->score ? -1 : 1;
    	} else {
    		if ( isset($a->score) ) {
    			return 1;
    		}
    		if ( isset($b->score) ) {
    			return -1;
    		}
    	}
    	
    	return 0;
    });

    This one is pretty ugly, but it should be close to a possible solution.

    As for your other question, unfortunately it is not possible to create multiple inputs for the same form. You can however create an input custom field filter. Then you can fetch the value of that filter from the $args[‘post_meta_filter’] argument.

    in reply to: I don't get the behaviour of custom field search #44442
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Michael,

    Thank you for the details!

    The unwanted items in the search were from the taxonomy gresys_tag, which I disabled for you here. Those options are to return the taxonomy terms as results, and you don’t want that in your case.

    Now if you check the filters the items should be filtered correctly and the unwanted tags will no longer be displayed.

    in reply to: Media file search in WooCommerce #44441
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Multi select category filter #44440
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Taxonomy filter missing #44439
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thank you, that worked!

    I checked the configuration, and I changed this option for you.
    The results were seemingly not changing as those items were also displayed, which were not associated with the taxonomies. Now it should be all right.

    in reply to: Multi select category filter #44434
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Show only Future Events #44433
    Ernest MarcinkoErnest Marcinko
    Keymaster

    It’s likely only the date format and the field. I checked to see and you seem to be using the Events Manager plugin, for that this should work:

    add_filter("asp_query_args", "asp_query_args_apply_date", 10, 2);
    function asp_query_args_apply_date($args, $search_id) {
    	$args['post_meta_filter'][] = array(
    		'key'     => '_event_start',
    		'value'   => date('Y-m-d H:i:s'),
    		'operator' => '>=',
    		'allow_missing' => false
    	);
    	return $args;
    }
    in reply to: Limit title length #44432
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Show only Future Events #44427
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    Thank you for your kind words!

    Surely it is possible, but you may need a few lines of code for it. I am not exactly sure about the plugin you are using for events, but I have constructed a custom code snippet, which should do exactly that if the date format is what I think it is. You will find it below.

    Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    add_filter("asp_query_args", "asp_query_args_apply_date", 10, 2);
    function asp_query_args_apply_date($args, $search_id) {
    	$args['post_meta_filter'][] = array(
    		'key'     => '_event_start_date',
    		'value'   => date('Y-m-d'),
    		'operator' => '>=',
    		'allow_missing' => false
    	);
    	return $args;
    }
    in reply to: Limit title length #44426
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Taxonomy filter missing #44422
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thank you for the details!

    The list only displays the first post type name associated, it is a visual thing only, it will still apply to all post types assigned with the taxonomy, you don’t have to worr about that.

    I tried to log-in to quicky look at the settings, but the username/password is not working unfortuantely. Can you please check that?
    The post type filter seems to be working okay, that is a very good sign, so this is very likely only a minor misconfiguration.

    in reply to: The plugin can not find pdf files #44420
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Category filters not working #44419
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Limit title length #44412
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 15 posts - 3,751 through 3,765 (of 18,427 total)