AbdullahAsn adlı üyeden alıntı: mesajı görüntüle
Arkadaşlar elimde böyle bir kod var bu kod aramayı çalıştırıyor.

Ama kod shop Bölümünü ve code bölümünü aratıyor . ben yazıları ve categorileride aratmasını istiyorum.

yani örnek

Samsung galaxy s6 yazınca sitedeki Samsung galaxy s6 kelimesini arıcak ama aşagıdaki kodda sadece shop ve code bölümünü aratıyor ben kategorileride yazılarıda aramasını istiyorum bunu nasıl düzeltebilirim

sistem wordpress

/* coupon ajax search function */ 
function coupon_ajax_search(){ 
    global $wpdb; 
    $search_term = esc_sql( $_POST['search'] ); 
    $response = array( 
        "list" => array() 
    ); 
     
    $query = "SELECT * FROM {$wpdb->prefix}posts WHERE post_status='publish' AND post_type='shop' AND post_title LIKE '%{$search_term}%' ORDER BY post_title ASC"; 
     
    $results = $wpdb->get_results( $query ); 
     
    if( !empty( $results ) ){ 
        foreach( $results as $result ){ 
            $title = str_replace( " ", " ", $result->post_title ); 
            $response["list"][] = array( 
                "name"     => urlencode( $title ), 
                "url"    => urlencode( get_permalink( $result->ID ) ) 
            ); 
        } 
    } 
     
    echo json_encode( $response ); 
    die(); 
} 
add_action('wp_ajax_ajax_search', 'coupon_ajax_search'); 
add_action('wp_ajax_nopriv_ajax_search', 'coupon_ajax_search'); 

function coupon_get_code(){ 
    $codeid = $_POST['codeid']; 
    $response = array(); 
     
    $code = get_post( $codeid ); 
    if( !empty( $code ) ){ 
        coupon_register_click( $codeid ); 
        $code_meta = get_post_custom( $codeid ); 
        $code_couponcode = coupon_get_smeta( 'code_couponcode', $code_meta, '' ); 
        $shop_id = coupon_get_smeta( 'code_shop_id', $code_meta, '' ); 
        $thumb_id = get_post_thumbnail_id( $shop_id ); 
        $image = wp_get_attachment_image_src( $thumb_id, 'top20' ); 
        $response['image'] = !empty( $image ) ? $image[0] : ''; 
        $response['title'] = $code->post_title; 
        $response['text'] = $code->post_content; 
        $response['code'] = $code_couponcode; 
    } 
    else{ 
        $response['error'] = __( 'Coupon does not exists', 'coupon' ); 
    } 
     
    echo json_encode( $response ); 
    die(); 
} 
add_action('wp_ajax_ajax_code', 'coupon_get_code'); 
add_action('wp_ajax_nopriv_ajax_code', 'coupon_get_code');
Diğer kodlarınızı görmediğim çalışıp çalışmayacağını bilmem ama shopta araması normal çünkü yukardaki kodlarınızda post_type='shop' shop olarak belirtilmiş, post_type='post' diye değişirseniz normal şartlar altında çalışır ama dediğim gibi kodlarınızın tamamını görmediğim için birşey diyemicem yedeğinizi alıp kodu değiştirip dener misiniz?
Code kısmı için özel anahtarlar da vs arama yaptırılmış oranında elden geçmesi gerekiyor.
İyi çalışmalar dilerim