this is ok, (

it's working)
global $wpdb;
$xc_show = $wpdb->get_var("SELECT meta_value FROM wp_postmeta where meta_key='_xc' and post_id='$order_id->ID'");
echo $xc_show;

or this ok (so it’s working)

$xc_showno = $order_id->get_id();
echo sprintf( '<a href="%s" target="_blank" >myLink</a>', 'http://localhost:81/?page_id='. $xc_showno);

but if I dont want use “echo” ? What can I use instead of “echo” for displaying any field from wp_postmeta? so how can I displaying any field form wp_postmeta on the page? is this possible?

Read more here: show any field from wp_postmeta on the page?


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

Wordpress related questions and answers: