1
このタイプの投稿で作成された他の投稿を検索することを許可しないようにする、非常に特殊なタイプのカスタム投稿タイプを作成したいアクセスするためのリンクが送信されます。私はこれまで持っていることはこれです:Wordpressでカスタム投稿タイプを検索できない
function pp_register_post_type(){
$labels = array(
'name' => _x('Viajes', 'post type general name', 'negocios'),
'singular_name' => _x('Viajes', 'post type singular name', 'negocios'),
'menu_name' => _x('Viajes', 'admin menu', 'negocios'),
'name_admin_bar' => _x('Viajes', 'add new on admin bar', 'negocios'),
'add_new' => _x('Add New', 'Viajes', 'negocios'),
'add_new_item' => __('Add New Viajes', 'negocios'),
);
$args = array(
'labels' => $labels,
'description' => __('Description.', 'negocios'),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => 'Viajes'),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'),
'menu_icon' => 'dashicons-welcome-write-blog'
);
register_post_type('pp_portfolio', $args);
}
add_action('init', 'pp_register_post_type');
私はfalseに'publicly_queryable' => true,
を設定すると、それを行うだろうと思ったが、ポストが作成されたときに何が代わりに行いますがパーマリンクを登録しないことです。それから私が投稿を見ようとすると、私はホームページに私を送ります。
$args
を設定して、archive.phpが日付リストやその他のクエリの投稿リストを表示しないようにするにはどうすればよいですか?誰かがこれらの投稿タイプを検索しようとすると、私は実際に404ページを出力したいのです。私はどうすればこれについて行くことができますか?
ありがとうございます!どのように私はそれを逃したのか分からない。 – Agustin