• Resolved dponi00

    (@dponi00)


    Hello!

    I hope you’re doing well. I have a couple of fields that I’ve added to my registration form with ACF Pro. They’re select fields. I have chosen to activate the stylized UI with select2, but it isn’t applying it to the forms created by this plugin.

    It works fine if I create a form with just ACF(Pro). How can I make TML apply the select2 styles as well?

    Thank you and have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    ACF likely loads a stylesheet specific to this UI when it detects one of it’s forms being displayed – which TML is not. This is likely a better question for them.

    Thread Starter dponi00

    (@dponi00)

    Hi Jeff,

    Thanks for your reply. I contacted them and came up with a solution. I’ll post it here in case anyone needs it:

    I added this via Code Snippets and set it to run frontend only.

    
    add_action('wp_head', 'add_acf_scripts');
    function add_acf_scripts()
    {
        if ( is_page( 160 ) ) { //enter the page's id
            acf_enqueue_scripts();
        }
    }
    

    Have a nice day and stay safe ??

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Nice – but instead of is_page(), I would use tml_is_action():

    
    add_action('wp_head', 'add_acf_scripts');
    function add_acf_scripts()
    {
        if ( tml_is_action( 'register' ) ) {
            acf_enqueue_scripts();
        }
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select2 for custom fields added with ACF’ is closed to new replies.