Home › Forums › General Issues › How to display the custom field content in single product page? › Reply To: How to display the custom field content in single product page?
`Hi, I’ve able to achieve this in a new tab in woo commerce single product page by using below code
function woo_products_tabs ( $tabs ){
$tabs[‘your_tab_name’] = Array
(
‘title’ => “Tab_title”,
‘priority’ => 15,
‘callback’ => ‘your_tab_name’
);
return $tabs;
}
function your_tab_name(){
echo “<h2>Tab_title</h2>”;
$var=get_field(‘acf_field_name’);
echo “<p> $var </p>”; // out put the datafield
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.