I am writing code in my wordpress themes folder. i am giving hyperlink to another page from my index page but its not working.
<li><a href="admin/admin.php"> Admin </a></li>
Link is not working like this
I am new to wordpress. Can anybody help me with this.
Thanks in advance
You have to use full path for that link, so, that would be http://site-url/slug. You can achieve that by using following code.
<li><a href="<?php echo site_url();?>/admin/admin.php"> Admin </a></li>
The site_url template tag retrieves the site url for the current site (where the WordPress core files reside) with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise.
You can read more about site_url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With