Link to Portfolio page by id instead of name
I'm trying to make a dynamic button that goes to portfolio page (no matter what ID/name it has), it's currently 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 problem is that it links based on the page name, and when it has space on the name it bugs... So I would need a code that links dynamically to the portfolio page by ID
When I try 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