Tried to add HTML above community event but now have error

Home Forums Calendar Products Community Events Tried to add HTML above community event but now have error

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #958399
    Gisela Nilsson
    Participant

    Hi, I am a complete beginner and attempted to add some html code to the function.php file and now I can’t access admin in WP anymore. I know what to remove but I don’t know how to get into the file again to remove it.

    I wanted to add instruction above the form for Community events and found this article:
    https://theeventscalendar.com/knowledgebase/add-html-above-community-events-submission-form/

    I added the html at the very end in function.php which I realize was wrong…

    I get this error:
    Parse error: syntax error, unexpected ‘Event’ (T_STRING), expecting ‘,’ or ‘;’ in /home/gisnil/guidetovintage.com/wp-content/themes/sugar-and-spice/functions.php on line 314

    What should I do to get back into Admin and remove the html I added? Please be very very detailed as I am a complete novice.

    As I know what the issue is, I have not deactivated any plugins or reverted the theme. My site is not launched yet.

    THANK YOU!!!!!!

    #958587
    Geoff
    Member

    Hi guidegirl, thanks for getting in touch and welcome to the forums!

    Sorry for the trouble here. It looks like you may just need to try pasting that snippet into you functions.php file a little differently.

    Are you able to try pasting it again right after the opening <?php tag at the top of the file? Does that change anything for you?

    Otherwise, you can try pasting it at the very bottom of the file, but try wrapping in in PHP tags:

    <?php // Adds HTML above Community Events form
    add_action('tribe_events_community_form_before_template', 'my_custom_text'); function my_custom_text() { echo "
    
    Here are some instructions for filling out this form:
    
    "; echo "</pre>
    <ol>
    <li>Step 1</li>
    <li>Step 2</li>
    <li>Step 3</li>
    <li>Step 4</li>
    </ol>
    <pre>"; }
    ?>

    Let’s start there and see what we find. 🙂

    Cheers!
    Geoff

    #958766
    Gisela Nilsson
    Participant

    Hi Geoff,

    thank you for the quick response. I had a friend help me out so the issue is solved.

    Glad to know you guys are there in case I mess up again.

    Thank you,
    Gisela

    #958917
    Geoff
    Member

    Sweet, I’m glad things got sorted out! We’re definitely here for you, so please feel free to hit us back up with a new thread if any other questions pop up and we’d be happy to help. 🙂

    Cheers!
    Geoff

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Tried to add HTML above community event but now have error’ is closed to new replies.