Support

Account

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.