I would like to move my large php functions out of the index or template files and into the function.php file. Would it be something like this?
function grab_code(???) {
??? .= '<div>some HTML-PHP code I monkeyed together</div>';
return ????;
}
add_filter('???', 'grab_code');
Then in the template files i would add?
echo grab_code(???);
I found answers here that look close to what I am asking but the seem specific to a function.
Thanks.