WordPress.org

Ready to get started?Download WordPress

Forums

Adding in scripts to pages (3 posts)

  1. g7kse
    Member
    Posted 6 years ago #

    I've got a directory that is constatly updated with gif images every hour. I've had to 'copy' my page template to display these updated images as the script used doesn't seem to work on a normal page.

    is thera plugin that can run this code, there's 3 images updated but the code for one of them is....

    var d = new Date();
    var m = d.getUTCMonth()+1;
    var day = d.getUTCDate();
    var yr = d.getUTCFullYear();
    var sname = yr+"-"+(m < 10 ? "0" + m : m)+"/S-"+yr+"-"+(m < 10 ? "0" + m : m)+"-"+(day < 10 ? "0" + day : day)+".gif";
    var pname = yr+"-"+(m < 10 ? "0" + m : m)+"/P-"+yr+"-"+(m < 10 ? "0" + m : m)+"-"+(day < 10 ? "0" + day : day)+".gif";
    document.write("Signal to noise ratio - Today");

    document.write("<table><tr><td width=\"800\"><p align=\"center\"><img src=\"scale.gif\" width=\"519\" alt=\"Scale\"><br><img src=\""+sname+"\" width=\"519\" height=\"1038\" title=\"SNR Today\"><br>SNR</td>");
    document.write("</tr></table><br><hr><br>");

    Any help for a numptie would be appreciated.

    Ta

    Alex

  2. syncbox
    Member
    Posted 6 years ago #

    try using the (is_page()) conditional to echo the script (don't forget to include the script tags) in your page.php file?

  3. g7kse
    Member
    Posted 6 years ago #

    I've ended up creating a page template with the code in it and it seems to do the trick nicely. Thanks for the help though

    Alex

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags