简体   繁体   中英

Custom URL in get method for wordpress

I had add this form in homepage of my theme

<form action="" method="GET">
    <label>NAME:</label>
    <input type="text" name="name" id="name" required/>
    <button>GET</button>
</form>

<?php

 if (isset($_GET['name'])){

    $name = $_GET['name'];

  echo "hello".$name;}
?>

and here I am getting url at top is

example.com/?name=google

and i want custom url as

example.com/name/google

so what should i do to get custom URL by get method?

将永久链接更改为postname wp自动将其转换

Go to Permalink settings in wordpress wp-admin . From there, select the option custom type or post type according to your requirements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM