It is incredibly bad practice to hardcode urls, almost as bad practice as hardcoded menus.
I strongly suggest you research custom nav menus. It will save yourself a large amount of time in development, and support costs, and it’s something to demonstrate to your client to gain kudos.
Hardcoding menus is a major warning sign of poor code, and it reflects badly on you. Having said that not everyone is aware, and I understand this may be new to you, in which case I hope you find it useful.
The Hardcoded Fix
If you really, really, must hardcode things ( and all the little kittens that die as a result ), at least make it dynamic so that if your sites URL changes, so does the link:
<?php echo home_url('/produkter/vatten'); ?>
Related Posts:
- Internal Links to Pages in PHP?
- How to display page title+link of page created by user
- Putting footer content in a “page” – Doing it wrong?
- Add a Menu Link (to a WordPress Page) in the Admin Menu/Sidebar
- Relative instead of absolute links in pages?
- Related Links Page with moderated, user suggested link submissions
- I can’t edit my homepage – the page editor is just blank [closed]
- Google Analytics tracking code on just one page?
- Getting ACF Field in Page – From the Footer
- Get all children titles of a page as a link to them
- Print page content with formatting when doing custom SQL query
- anchor tag in header not working on other pages except the home page
- Hide links to pages that dont have any content
- How do you run code on a specific page without missing the init hook?
- Add homepage to the list of pages in the Footer Widget
- Add pagination to search.php page
- Access link page and not folder content of that link
- Attach link to pages accoding to tags
- How to achieve anchor links on top of pages.
- Footer doesn’t display in page.php
- one time visit to the page
- What is the difference between $paged and $page?
- Custom SQL Query for WordPress page
- Change admin startpage to Pages-page?
- How restrict page for users logged? [closed]
- Only allow new subpages to be created
- Hide Visibility Option From WordPress Publish Metabox
- How to make nested page structure?
- Redirect to a page if ancestors is empty
- Get Order of Meta Box in a Page/Post
- Modify Page Title before output via wp_page_list
- List Child Pages of Parent Parent Page (Child pages from Grand Parent)
- How to add meta boxes to Pages
- Missing parent page attribute
- Hiding Page by Title from Editing
- Two Search pages, One search form
- htaccess modify headers IF url ends with “news”
- How to change only the home page / front page url on wordpress
- Give access to a simple .html file to users that bought a specific ‘digital product’
- List child pages by slug not ID?
- Force page to open in html mode
- Dash after page title
- Can’t get done anything with admin.php response
- Role – edit page but not publish
- get_pages() & “child_of”
- Unique page URL redirect to file_get_contents() at domain
- Cannot add a class to h2 tag
- How to handle broken links created by permalink/slug changes?
- How to detect if is_404() or is_page() or etc…? [closed]
- Redirect page to default subpage
- Add a static page that links to homepage
- How can I get the blog page ID?
- How to have a next page for post?
- Can I change the “Home” text in the menu?
- Search child pages from a specific page parent
- Proper procedure for wp_insert_post?
- Read more on pages WordPress
- Parent page shows no child content
- How to disable delete option for a specific page? [closed]
- How to create different template designs for different pages in WordPress [closed]
- Page templates in subdirectories and auto generator
- Use page template for custom $_GET content
- Get rid of “comment” field on non-blog pages [duplicate]
- Custom page only editable by one user
- Page Title repeating
- How to control display of page lists on sidebar that doesn’t have childrens
- Is there a template tag/function for getting the URL (or slug or name or ID) of the blog page when using a “static” front page
- Problems in creating a static site with WordPress
- Creating new page/tab in groups section not working! [closed]
- Prompting for review / reapproval of page content
- Limit the amount of main pages
- Add separate list of pages under Admin
- remove “Edit” from select pages
- Add custom action to the page listing screen
- How to list pages from an author?
- Cannot update page – with too many characters?
- Share a folder with files
- Front Page post mirroring revisions to other pages, constantly updating itself
- Is it possible to embedd this web app to my website [duplicate]
- Using external DB within wordpress
- Microsoft Security Essentials is blocking my WordPress website in IE11
- Author information on all pages
- Pre-populating new Page creation with shortcodes
- WordPress Pages “allow comments” meta option can’t be checked
- Loading internal page
- Firing page_publish where page is child page
- Add role and edit page capabilities
- Google indexed pages for one page site
- WordPress, page 2 shows the same posts as page 1
- Parent for a single (single.php)
- Create a new page for each form selection
- pagination does not work with query_posts. Help! [duplicate]
- Subpage Conditional
- How can one get page by pagename if it is a child page?
- Archive with specific keyword by category sorted by date
- How to pass the Querystring in pages?
- Edit the text location of a form
- User profile in front-end
- custom css in one page
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?