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

essenciadigital74

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Search in content file #25533
    essenciadigital74essenciadigital74
    Participant

    Hello,

    even with this configuration still does not seek.

    in reply to: asp_query_args IS NOT WORKING #25510
    essenciadigital74essenciadigital74
    Participant

    Hello!
    How are you ?

    Do you have some answer about my previous question? I still cannot use the function, which worked 2 weeks ago…

    Thank you.

    in reply to: asp_query_args IS NOT WORKING #25369
    essenciadigital74essenciadigital74
    Participant

    Hey, it is almost that but thank you a lot!

    I just want to know if the function will run, because I put an exit() inside it and nothing changed.

    in reply to: asp_query_args IS NOT WORKING #25365
    essenciadigital74essenciadigital74
    Participant
    add_filter("asp_query_args", "asp_query_args_change", 1, 3);
    
    function asp_query_args_change($args, $search_id) {
    	$post_id = get_string_between($_POST['options'], "current_page_id=", "&qtranslate_lang");
        if($search_id == 3) {
          $args['post_type'] = array('post');
          $args['post_fields'] = array('title', 'content', 'excerpt', 'terms');
          $args['post_tax_filter'] = array(
            array(
                'taxonomy'  => 'category',
                'include'   => wp_get_post_categories($post_id)
            )
          );
        }
      return $args;
    }
    
    function get_string_between($string, $start, $end){
        $string = ' ' . $string;
        $ini = strpos($string, $start);
        if ($ini == 0) return '';
        $ini += strlen($start);
        $len = strpos($string, $end, $ini) - $ini;
        return substr($string, $ini, $len);
    }
Viewing 4 posts - 1 through 4 (of 4 total)