Masuk ke edit theme > function.php lalu masukkan kode berikut ini dipaling bawah:
function custom_search_rewrite_rule($rules) {
$new_rules = array(
'search/(.+)/?$' => 'index.php?s=' . $wp_rewrite->preg_index(1)
);
return $new_rules + $rules;
}
add_filter('rewrite_rules_array', 'custom_search_rewrite_rule');
function change_search_links() {
if (is_search() && !empty($_GET['s'])) {
wp_redirect(home_url("/search/") . urlencode(get_query_var('s')));
exit();
}
}
add_action('template_redirect', 'change_search_links');
0 Response to "Cara Merubah Permalink Search Wordpress Menjadi /search/"
Posting Komentar