WordPress.org

Support

Support » How-To and Troubleshooting » insert into a single page

insert into a single page

  • Hi!

    I am certain this is a very basic question someone can answer quickly and well. I’m pretty much a php noob and I did not write, but need to insert , the following 2 lines into a single page on a WP site for a client.

    <script src=”//survey.aspx”></script>
    and
    <script src=”//survey.js”></script>

    JS is enqueued properly.

    thoughts?

Viewing 13 replies - 1 through 13 (of 13 total)
  • esmi

    @esmi

    Forum Moderator

    I don’t think you can usually run an .aspx script on a PHP enabled server. And if your .js is correctly enqueued, why would you be adding <script src="//survey.js"></script> to any file?

    I guess it isn’t! I’m coming in very late to this project. Everything looks to be in order on header.php and functions.php.

    I just really do not know what to do. I’m also not confident I can properly format that in php.

    esmi

    @esmi

    Forum Moderator

    Have you reviewed wp_enqueue_script()?

    yes.

    So – here’s what’s happened.

    Went from wp_enqueue_script to my page template.php file. Edited it to include the enqueue call. got “Fatal Error: call to undefined function enqueuescript()”

    So added
    add_action(‘wp_enqueue_script’, ‘my_script’) to functions.php – and forgot to back-up. now getting Parse Error: syntax error, unexpected T_string in that file on a line that when I check in dreamweaver on my mac, isn’t there.

    how do I fix?

    so checked the code in a different editor.

    the error message says error is on line 922, which is just:

    <?php break;

    now even more confused.

    esmi

    @esmi

    Forum Moderator

    Try switching to the default theme by renaming your current theme’s folder inside wp-content/themes and adding “-old” to the end of the folder name using FTP or whatever file management application your host provides. That should get your site back up. Then you need to remove those changes from your theme’s function.php file.

    and if I don’t have ftp access right this instant?

    esmi

    @esmi

    Forum Moderator

    Then there’s absolutely nothing you can do until you get access. 🙁

    Thanks ESMI. ugh.

    esmi

    @esmi

    Forum Moderator

    I know it’s a bit late now but if you do plan on doing any more theme/code work, you might want to look at installing WordPress locally.

    Failing that, I’d suggest never editing a theme online if you can possibly avoid it. Instead, download the relevant template file using FTP, make a backup copy & then open in in a plain text editor. Make your changes, save the file & upload it. Then, if things do go pear-shaped, you can quickly upload your backup copy.

    Thanks again.

    I hate being brought in to things late like this for this very reason.

    Those are great points that I’ve used in other sites – just thought I’d be adding a line of code and was careless.

    Got into file manager, renamed the broken theme and now have the site up as twentythirteen.

    now – how do I correct the error in the broken theme?

    nm… had a copy of theme w/ no errors. resolved.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘insert into a single page’ is closed to new replies.
Skip to toolbar