I an creating a child theme and I have added a link in the footer.php file to a page within my website. I used the WordPress recommended:

<a href="<?php echo esc_url( get_permalink( get_page_by_title( 'PAGE TITLE' ) ) ); ?>">PAGE TITLE</a>

which displays the proper url when the link is clicked, but I get a 404 error. I determined that if I set my permalink setting to Default it will bring up the page, but the url is the permalink ID, not the slug. I want to use Post name for my permalinks for SEO purposes. Any suggestions?

Read more here: Internal link in WordPress footer.php file not working


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: