Home › Forums › Add-ons › Flexible Content Field › Dynamic title for flexible content pane? › Reply To: Dynamic title for flexible content pane?
Ooooh…. this is really cool!
I had given each block a different key/name – so, I changed that to ‘block_title’ – so that I could keep it simple.
`
add_filter(‘acf/fields/flexible_content/layout_title’, function($title) {
$ret = $title;
if ($custom_title = get_sub_field(‘block_title’)) {
$ret = sprintf($title . ‘: ‘ . ‘<strong>’ . $custom_title . ‘</strong>’);
}
return $ret;
});
`
Hooray!!! So cool! Thanks @antishow !
(for anyone else who finds this / the filter goes in your functions.php)
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.