• Resolved SaraCravewordpress-40

    (@saracravewordpress-40)


    I have the following instructions to upload files to the server (but not where within th wordpress folders to save)

    To start using this script right away, please follow these steps:
    1/Open the “source” folder
    2/Copy the “css” and “js” folders + one of the “BF_” prefixed file that you have selected, to your server and you’re ready to go
    3/Additionally, you can open the selected “BF_” prefixed file with a text editor copy the code and paste it inside your website

    Where within my WP folders in the server would I save these folders to?

    It is a script to run a calculator embeded in a blog page in the site. So I’m happy with copying the HTML code from the “BF” prefixed file and pasting that into the page, but not sure where to upload / save the files from the css and js folders?

    Grateful for any help with this

Viewing 7 replies - 1 through 7 (of 7 total)
  • Where within my WP folders in the server would I save these folders to?

    That question can best be answered by whoever gave you these instructions 😀

    Since this doesn’t appear to be a WordPress plugin or theme, it really has nothing to do with WordPress, and WordPress doesn’t care where you put it.

    The only thing that should matter is how this “script” is called. What I mean is if you’re using the script in a WordPress post/post, your code should appropriately point to wherever these resources required by the script are located.

    I think the folders are the asset files of the calculator and the prefixed file is the loader of those files inside the folders.

    To run the calculator, you have to ‘require_once’ the prefixed file in your theme’s functions.php file so that the CSS and JS file load properly on the exact page. Then, the calculator will be functioning on that page.

    Without seeing the files and code it is impossible to provide you an exact solution.

    Thanks

    Thread Starter SaraCravewordpress-40

    (@saracravewordpress-40)

    Thanks for your replies. Purchased off Code Canyon, and the developer is not responding to support query.

    The following from the HTML file;

    Start

    <div>
    <link rel=”stylesheet” type=”text/css” href=”css/bf-main.css”>
    <link rel=”stylesheet” type=”text/css” href=”css/bf-dark-grey.css”>
    <div id=”bfNoScript”>
    Please enable JavaScript to run this calculator
    </div>
    <!– Begin Calculator Inputs Area –>
    <form name=”bfCalculator” class=”bfCalculator”>
    <div class=”bf-calculator-container js-bf-calculator”>
    <div class=”bf-calculator-header”>

    End

    </div>
    </form>
    <!– End Calculator Inputs Area –>
    <script type=”text/javascript” src=”js/bf-calculator.js”></script>
    </div>

    Not sure if that helps make this any clearer

    From your provided code, I can assume that here the CSS and JS files are linked on the HTML part to load.

    To run these files and the Calculator form in WordPress you have to put the CSS and JS files in the asset folder of your theme and enqueue from the functions.php file. Then, you have to place the HTML form part of the calculator to the page where it should be loaded (blog).

    The script author might instruct you considering the calculator for static HTML page (not for WordPress).

    If I could check the files and try on your staging site, I could help you.
    I think you should contact with the dev team.

    Moderator bcworkz

    (@bcworkz)

    Uzzal is basically correct, except if your theme is subject to periodic updates you should be using a child theme to contain your customized elements so they are not lost during updates. If this all sounds complicated, it can be. The reason for it in part is to ensure portability of code between various installations.

    If you’re not concerned with portability, instead of enqueuing like we are supposed to do, you could place the calculator assets where ever you like on your server, outside of the WP folder structure, then reference the files using the correct paths to where ever they reside. You can then simply hard code the style and script tags right on your template code. Because you are altering templates, you still may need a child theme, but enqueuing isn’t strictly required if WP resources are not needed.

    This is not an ideal approach, but it could help you get something working quicker if you’re not familiar with enqueuing styles and scripts. Once you get something working, I encourage you to still revisit this at your leisure and learn what it takes to do things the right way 🙂

    BTW, your sample code is using relative file references. What is relative to what in WP is often ambiguous. You should be using full, absolute paths and URLs within WP.

    Thread Starter SaraCravewordpress-40

    (@saracravewordpress-40)

    Thanks for your helpful tips guys.

    Helps me to know some of the things that need to be done correctly, so I will have a further go at getting this to work.

    Thread Starter SaraCravewordpress-40

    (@saracravewordpress-40)

    Thanks for everyone’s input on this, I appreciate the help.

    Got it done. uploaded to folder outside of wordpress and created an iframe src path to the html file. Set an iframe size which seems to work for desktop and mobile responsive to suite tablet and mobile. calculator is about half way down this page glad I could work this out:)

    Thanks all

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding js and css folders to server for app’ is closed to new replies.