PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Sorry: Parse error: syntax error, unexpected '

  1. i think I have missed something...

    http://www.gravityhelp.com/forums/topic/change-title#post-73614

    these code need to be pasted directly as they are into the functions.php

    I keep getting errors

    Parse error: syntax error, unexpected '<' in /hermes/waloraweb044/b2035/moo.neuroknowhowcom/neurodiversecity/wp-content/themes/organic_nonprofit/functions.php on line 446

    :(

    I am sooooo lame!

    Posted 11 years ago on Monday September 3, 2012 | Permalink
  2. If you post your complete functions.php to pastie.org or pastebin.com we can help you with the syntax error. Sounds like you need to remove the first line: the <?php - take that out and see if it works. Sometimes, depending on where you pasted it, you have to remove the first and last lines, if you're already inside a PHP block.

    Post your whole functions.php (not here) and we will help you straighten it out.

    Posted 11 years ago on Monday September 3, 2012 | Permalink
  3. I played with that, but had no Joy.

    I will play a bit more based on what you say above and then paste if no joy

    cheers again Chris!!!

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  4. Sure thing. This is a simple fix for someone who knows what they're looking at, or using a syntax highlighting editor. We're happy to take a look for you.

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  5. If I only wanted to apply this to one form

    Would I have to but the form id anywhere in the code below?

    add_filter("gform_product", "change_product", 10, 11);
    function change_product($label, $form_id){
    return "Services";

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  6. http://pastebin.com/huKHubgM

    is there a particular place where the code should go.

    I havent placed here

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  7. Put it right at line 446 in that paste, but remove the opening <?php and closing ?> otherwise you will get a parse error again. The code you paste should be just this:

    [php]
    // change Product to Service
    add_filter("gform_product", "change_product", 10, 2);
    function change_product($label, $form_id) {
        return "Service";
    }

    Add the other lines immediately after these 5, right before the closing ?> in your file. Don't paste in the <?php or ?> or bad things will happen.

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  8. Cool! Very Cool!

    If there was another form with a product (a physical item, just thinking ahead here), would that be possible to have services and product.

    or would that be another table?

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  9. done

    gonna apply the same thing to order

    cheers

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  10. Services and Product in the same form? Or do you mean just not use Services in the other form? I don't know of a way to have one form with both labels, but we can have different forms each with their own label.

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  11. I suppose the heading could be Services/Product

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  12. All good for now.

    Just gonna change "order"

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  13. David Peralty

    Probably the best solution without duplicating the form or writing some more PHP to check for page and whatnot. Let us know if you need anything else.

    Posted 11 years ago on Tuesday September 4, 2012 | Permalink
  14. cool!

    Posted 11 years ago on Wednesday September 5, 2012 | Permalink

This topic has been resolved and has been closed to new replies.