Adding custom class to checkout

Home Forums Chit Chat WPLMS customizations Adding custom class to checkout

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113145
    rinalds26
    Spectator
    <span style="color: #666666; font-family: 'Open Sans', Arial, sans-serif;">Hi. I need to set a custom class called “custom-checkout” to my checkout shortcode. But I can't find any option to add custom class to specific page. </span>
    #116107
    MrVibe
    Keymaster
    You can use body_class filter for this. Not sure if this is possible via Shortcode, but something like this should work :   add_filter('body_class',function($classes){ if(function_exists('wc_get_page_id')){ $checkout_id = wc_get_page_id('checkout'); if(!empty($checkout_id)){ if(is_page($checkout_id)){ $classes[]='custom-checkout'; } } } return $classes; });   p.s : Make sure you have FTP details when you're trying this.
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Adding custom class to checkout’ is closed to new replies.