• Resolved davidgimenezq

    (@davidgimenezq)


    How I can add a custom class to a custom field?

    This is currently displayed:

    <div class=”atbd_custom_field_content”>
    <p>Example 1</p>
    </div>

    <div class=”atbd_custom_field_content”>
    <p>Example 2</p>
    </div>

    I want this to be displayed:

    <div class=”atbd_custom_field_content custom1“>
    <p>Example</p>
    </div>

    <div class=”atbd_custom_field_content custom2“>
    <p>Example</p>
    </div>

    This is to be able to put a custom style to each of the custom fields.
    If not, could you give me some idea to carry it out.

    Please i need help, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Rafiz Sejim

    (@rafizsejim)

    Hello David,

    Thank you for reaching us out. Please go through the reply below.

    Regards,

    • This reply was modified 4 years, 10 months ago by Rafiz Sejim.

    Hello David,

    Thank you for reaching us out.

    It is not possible to add custom class to a custom field in the current version. However we’ve added a filter hook for it in the beta version, so that you can do your customization.

    Please install the beta version and then add the following hook in your themes function.php file to apply the hook.

    
    add_filter( 'atbdp_custom_field_class', 'add_custom_field_class', 10, 2);
    function add_custom_field_class( $content, $id ) {
      $classes     = " new-custom-class new-custom-class-$id";
      $new_classes = $content . $classes;
    
      return $new_classes;	
    }
    

    We always strive for customer satisfaction. Our plugin is free to use and the only thing that keeps us motivated is the reviews. Would it be possible for you to spend a couple of minutes from your valuable time reviewing our plugin here?
    It would greatly help us to amp our performance!

    Best Regards

    • This reply was modified 4 years, 10 months ago by aazztech.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom fields’ is closed to new replies.