Support » Themes and Templates » Site Broke wp-content/themes/twentytwelve/functions.php on line 428

  • Resolved fakankun


    My site

    I was trying to add this code so I could customize the text on a password protected post.

    function custom_password_form($form) {
      $subs = array(
        '#<p>This post is password protected. To view it please enter your password below:</p>#' => '<p>THIS LEGAL CONTENT REQUIRES A PASSWORD, IF YOU DO NOT HAVE ONE PLEASE REQUEST ONE FROM INFO@PLAYLANDCOM.COM</p>',
        '#<form(.*?)>#' => '<form$1 class="passwordform">',
        '#<input(.*?)type="password"(.*?) />#' => '<input$1type="password"$2 class="text" />',
        '#<input(.*?)type="submit"(.*?) />#' => '<input$1type="submit"$2 class="button" />'
      echo preg_replace(array_keys($subs), array_values($subs), $form);
    add_filter('the_password_form', 'custom_password_form');

    Now I get this error:

    Parse error: syntax error, unexpected ‘<‘ in wp-content/themes/twentytwelve/functions.php on line 428

    But in paste bin, line 428 is: );

    Any help?

    This is also the error I got after getting a new functions.php file and re-uploading it

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can you paste the entire functions.php code in pastebin and provide a link so that we can take a look for you

    I actually re-uploaded the entire theme, and it’s working again. I’m not sure if this would help others, but I don’t seem to be missing anything from the previous installation.

    I do appreciate the quick response though!

    – Lu

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site Broke wp-content/themes/twentytwelve/functions.php on line 428’ is closed to new replies.