WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help me use bigvideo.js in WordPress? (3 posts)

  1. KeithAdv
    Member
    Posted 8 months ago #

    I'm hoping someone can break this down so I can understand it!

    I'm fairly good with css, just a beginner on javascript and php. Not so well educated on when/how to include/import stuff. But I'd love to use the jquery bigvideo plugin on a site, if I can get over the tech part!

    Here is the BIGVIDEO.JS intro

    And here is a tutorial by the creator

    It's the simple stuff I trip over--where and how to include what--I just don't know how to WordPress-ify code like this! However, I'd love to get it up and running and all help would be appreciated! Thank you!

  2. bcworkz
    Member
    Posted 8 months ago #

    Since you are altering markup and CSS, you will want to create a child theme to protect your changes from theme updates. Figuring out which templates to alter can be confusing. Start by looking at header.php and index.php. The CSS goes on your child theme's styles.css.

    The javascript can go in a .js file stored in a /js/ folder of your child theme. It may go elsewhere, but this format is used consistently by WP, you may as well adopt it. In order to have meta links in the page head section linking to your javascript files, do NOT hardcode the meta links in header.php. You must use wp_enqueue_script(), which will insert the meta links for you, as well as resolve any dependencies. The enqueue script code goes on your child theme's functions.php file.

  3. KeithAdv
    Member
    Posted 7 months ago #

    ..., do NOT hardcode the meta links in header.php. You must use wp_enqueue_script(), which will insert the meta links for you, as well as resolve any dependencies. The enqueue script code goes on your child theme's functions.php file.

    This. I needed to go get a very good understanding of wp_register_script and wp_enqueue_script process, which I did. Everything works now. Thank you very much!

Reply

You must log in to post.

About this Topic