• fumidalat

    (@fumidalat)


    http://sukoburu-ssl.com/area/
    こちらは普通の投稿のカスタムフィールドに入れた値での検索です

    http://sukoburu-ssl.com/members-only
    これとは別に会員用の検索を作りたいので、カスタム投稿のカスアムフィールドに値を登録しました
    その検索用ページが上です。
    今は会員ではなくてもアクセスできます

    2つのフォームからの検索結果が同じになってしまいます
    functions.phpに書いた

    function custom_search_template($template){
      if ( is_search() ){
        $post_types = get_query_var('members');
        foreach ( (array) $post_types as $post_type )
          $templates[] = "search-{$post_type}.php";
          $templates[] = 'search.php';
           $template = get_query_template('search',$templates);
      }
      return $template;
    }

          $templates[] = "search-{$post_type}.php";
    

    が効いていないようです。

    そもそもの問題としてカスタム投稿のカスタムフィールドを普通の投稿のカスタムフィールドのように検索できるのかどうか。
    それもわかっていません

    よろしくお願いします。

    ヘルプの必要なページ: [リンクを見るにはログイン]

  • トピック「カスタム投稿のカスタムフィールド検索」には新たに返信することはできません。