I an newbie in PHP and I have the following in a template file.
$url = get_permalink(get_page_by_title('Main'));
But the above line gives me an error ..
Fatal error: Call to undefined function get_permalink() in C:wampwwwwordpresswp-contentthemestwentysixteenhandleLogin.php
I tried including the file link-template
at the top by using the below line but it doesn’t find the file either.
include_once 'wp-includes/link-template.php';
I googled but everyone seems to have it working .. those who complained were having typos in the function name which are not my cases.
Any help will be appreciated. Thanks.
I know this is a very old post. But posting if anyone comes looking for answers like me.
After requiring, wp-load.php add below,