Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using in theme #12

Open
sajjadazar opened this issue Sep 17, 2021 · 0 comments
Open

using in theme #12

sajjadazar opened this issue Sep 17, 2021 · 0 comments

Comments

@sajjadazar
Copy link

hello to everybody
first of all thank you for this awesome project.
i just want to tell you there is a thing. if you want use it to your custom theme the styles and scripts will not load.

`/**
* Enqueue scripts and styles
*/
public function setup_admin_scripts() {
wp_register_script( 'cmb-tabs', plugins_url( 'js/tabs.js', FILE ), array( 'jquery' ), self::VERSION, true );
wp_enqueue_script( 'cmb-tabs' );

        wp_enqueue_style( 'cmb-tabs', plugins_url( 'css/tabs.css', __FILE__ ), array(), self::VERSION );
        wp_enqueue_style( 'cmb-tabs' );

    }

    /**
     * Enqueue dark mode styles
     */
    public function setup_dark_mode() {
        wp_enqueue_style( 'cmb-tabs-dark-mode', plugins_url( 'css/dark-mode.css', __FILE__ ), array(), self::VERSION );
        wp_enqueue_style( 'cmb-tabs-dark-mode' );

    }`

it will load files from plugins_url() but if you want use it in your theme you have to use this code :
`/**
* Enqueue scripts and styles
*/
public function setup_admin_scripts() {
wp_register_script( 'cmb-tabs', get_template_directory_uri() . '/cmb2-tabs-master/js/tabs.js', array( 'jquery' ), self::VERSION, true );
wp_enqueue_script( 'cmb-tabs' );

        wp_enqueue_style( 'cmb-tabs', get_template_directory_uri(). '/cmb2-tabs-master/css/tabs.css', array(), self::VERSION );
        wp_enqueue_style( 'cmb-tabs' );

    }

    /**
     * Enqueue dark mode styles
     */
    public function setup_dark_mode() {
        wp_enqueue_style( 'cmb-tabs-dark-mode', get_template_directory_uri(). '/cmb2-tabs-master/css/dark-mode.css', array(), self::VERSION );
        wp_enqueue_style( 'cmb-tabs-dark-mode' );

    }`

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant