[resolved] Site Broke wp-content/themes/twentytwelve/functions.php on line 428 (3 posts)

  1. fakankun
    Posted 2 years ago #

    My site http://loopholemarketers.com/

    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

  2. Brian Harris
    Posted 2 years ago #

    Can you paste the entire functions.php code in pastebin and provide a link so that we can take a look for you

  3. fakankun
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic