I can not display meta value in extras.php and template-tags.php
I have page template that stores reservation input fields, I would like add link to that specific page using meta box but my meta box doesnt work in extras.php and meta-tags.php, I would like to know where do I do a mistake or what should I do to retrieve meta value anywhere in all pages?
my function is:
function test_button() {
global $post; $bsub; $button_link;
$button_link = get_post_meta(get_the_ID(), '_but_subtitle', true);
echo 'a href='.esc_url( get_page_link( $button_link ) ).''.esc_html__( 'Reservation', 'text-domain' ).'/a';
and I'm calling function
if ( function_exists( 'test_button' ) ) {
global $post; $bsub; $button_link
test_button();
}
my function displays only current page or post (anwhere where it is) url
Topic meta-query meta-value post-meta metabox Wordpress
Category Web