0

I am working on a wordpress site.

A page contains a listing of different insurance companies and each list item has a button which redirects to a wordpress page where I display other details of that insurance company. I pass the ID of the company with the url and display the records through ID.

<a href="<?php echo $row->Kiesuwverzekering."?id=".$row->health_id;?>">
<img src="<?php echo $img_path."img-1.png"; ?>" />
</a> 

$row->Kiesuwverzekering is the link of that page, i want to display more details of company.

When redirected to that page url becomes

http://xyz.net/zorgverzekeringg/?id=40

Now I want it to be like -

http://xyz.net/zorgverzekeringg/companyname

Can I replace ?id=40 with companyname? Or should I pass company name in url? If yes then what if company name is like "my company"(without ") I mean what if company name have longer name having space?

2
  • permalink setting can help you codex.wordpress.org/Using_Permalinks Commented Nov 2, 2012 at 6:59
  • It all depends on how the page you are navigating to is configured. If it requires the ID from the query string, then you would also need to change edit that page. Also, what are your 'insurance companies?' Are they Posts, Terms, Pages, or what? Without knowing that it is difficult to say how to create the structure you want. Commented Nov 2, 2012 at 12:08

1 Answer 1

1

You can put page name/identifier instead of passing page id. Wordpress create a permanent link for each page. so first look page URL then get that part and add it in your base URL.

Sign up to request clarification or add additional context in comments.

2 Comments

id in not the id of page. id is table id in database
you are useing like mydomain.com?page_id=232?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.