Site icon Hip-Hop Website Design and Development

Hyperlink to Portfolio web page by id as a substitute of identify

I am attempting to make a dynamic button that goes to portfolio web page (it doesn’t matter what ID/identify it has), it is presently like this:

$portfolio_page = get_option('theme_portfolio_page');
$portfolio_pid = get_page_by_title($portfolio_page);

     <a href="<?php echo get_option ('theme_portfolio_page') ?>">Voltar</a>

The issue is that it hyperlinks based mostly on the web page identify, and when it has area on the identify it bugs… So I would wish a code that hyperlinks dynamically to the portfolio web page by ID

When I attempt to change to get_page_by_id

FATAL ERROR: CALL TO UNDEFINED FUNCTION GET_PAGE_BY_ID() IN /HOME/DOMAIN/WWW/WP-CONTENT/THEMES/MYTHEME/PORTFOLIO-TEMPLATE.PHP ON LINE 46