• Hello!

    I have a custom built mp3 player that I’m trying to put on my site.

    Really it isn’t even finished yet and I’m still working with my developer to finish and eventually implement it, I just want to hard code it in for the time being for looks and slight testing, plus for any users that might stumble on to my site.

    It works fine when I use it in a browser as just it’s own files, but I’m at a loss on adding it in to wordpress.

    I got some of it to be styled, some of it wasnt, some of it was messing with the rest of my page.

    The player includes:

    /HTML PLAYER

    player.html

    /js/ player.js (+) jquery.slimscroll.min.js

    /css/ style.css (+) fonts.css

    /css/fonts/ icomoon.eot (+) icomoon.svg (+) icomoon.ttf (+) icomoon.woff

    This was what I tried to do in my functions file:

    <?php
    
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    
    function jquery_slider() {
        wp_enqueue_script(
            'jquery-tabify',
            get_template_directory_uri() . '/js/player.js',
            array( 'jquery' )
        );
    }
    add_action( 'wp_enqueue_scripts', 'jquery_tabify' );
    
    function add_newstyle_stylesheet() {
        wp_register_style(
            'newstyle',
            get_template_directory_uri() . '/css/playerstyle.css'
        );
        wp_enqueue_style( 'newstyle' );
    }
    add_action( 'wp_enqueue_scripts', 'add_newstyle_stylesheet' );
    ?>

    I did get some styling applied to the thing, but it just wasn’t right.

    I’m attempting to put the html straight in to the text editor of a page on my site, then allow all these files to manipulate it as necessary.

    Really I just wanted to put it on there for fun and see how the site looked with it, and also to learn. Because one day I hope to be the guy building and integrating the player/plugin…..not on the forum asking how ??

  • The topic ‘Having trouble with functions.php and enqueue’ is closed to new replies.