I need a get current page Title and Page URL in footer.php or in a wp_footer action (https://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer)
What is the best way to get these values?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI need a get current page Title and Page URL in footer.php or in a wp_footer action (https://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer)
What is the best way to get these values?
You should get the title by get_the_title:
$page_title = esc_html( get_the_title() );
and the link by get_permalink:
$page_link = esc_url( get_permalink() );
... and perhaps use google ;)