Home › Forums › General Issues › Add post branding options, color, font › Reply To: Add post branding options, color, font
You are talking about filtering the content. This would not be easy to add. You’d need to create a new filter for “the_content”, then you’d need to parse all the HTML, find the parts that you want to change and alter them.
The other choice is to add custom CSS using the “get_header” hook
add_action('get_header', 'my_custom_page_css');
function my_custom_page_css() {
// we need to get the post ID because this is outside the loop
$queried_object = get_queried_object();
if (!isset($queried_object->ID)) {
// not a post
return;
}
$post_id = $queried_object->ID;
?>
<style type="text/css">
h1 {
color: <?php the_field('heading_color', $post_id);
}
</style>
<?php
}
I know this is an old topic so hopefully this helps someone.
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.