[Resolved] add css js my child theme generatepress

Home Forums Support [Resolved] add css js my child theme generatepress

Home Forums Support add css js my child theme generatepress

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #300001
    Sandro

    Hi i need add uikit library css and js, my child theme: cjt_tusoporte_wp

    my code functions.php –> Child Theme:

    /*** Load Custom Stylesheet CSS Child Theme UIKIT ***/
    
    function uikit_css_stylesheets() {
        wp_enqueue_style('uikit_css', get_stylesheet_directory_uri().'/css/uikit.min.css', array('cjt_tusoporte_wp'), '1.0');
    }
    add_filter( 'child_add_stylesheets', 'uikit_css_stylesheets' );
    
    /*** Load Custom Stylesheet JS Child Theme UIKIT ***/
    
    function uikit_js_javascript() {
        wp_enqueue_style('uikit-js', get_stylesheet_directory_uri().'/js/uikit.min.js', array('jquery'), '1.0');
    }
    add_filter('child_add_javascripts','uikit_js_javascript');

    I have read the documentation and this is the correct form but it does not work,

    Thks in advance,

    #300211
    Tom
    Lead Developer
    Lead Developer

    I believe it should be this:

    function uikit_css_stylesheets() {
        wp_enqueue_style('uikit_css', get_stylesheet_directory_uri().'/css/uikit.min.css', array('cjt_tusoporte_wp'), '1.0');
        wp_enqueue_style('uikit-js', get_stylesheet_directory_uri().'/js/uikit.min.js', array('jquery'), '1.0');
    }
    add_action('wp_enqueue_scripts','uikit_css_stylesheets');
    #300271
    Sandro

    Thks,

    Tom.

    #300318
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.