Grow your CSS skills. Land your dream job.

Parse error: syntax error, unexpected ‘/’ —-> i tried … but still there is an error

  • # January 26, 2012 at 2:44 am

    hi guys …
    i am working on wordpress theme , and i had some error here ..

    i working on comment form , and i would to put a text ( label ) after the input boxes .
    i tried many times but still there is error ..


    < ?php comment_form(
    array(
    array(
    'author' => '

    ' . ( $req ? '*' : '' ) .
    '

    ',
    'email' => '',
    'url' => '

    ' .
    '

    ',
    ),
    'comment_notes_after' => '',
    'comment_field' => '

    '

    ));

    there is error here between line 1 to 10 …

    the error :


    Parse error: syntax error, unexpected '/'

    # another questions :
    1- how can i give the box a default value …? like (your name – your email …etc ) instead of put < labels > before or after boxes ..
    2- the < textarea > , i want to make it not sizable .. because it make a distortion ..

    # January 26, 2012 at 3:49 am

    Real question: The last item in the one array ‘url’ ends with a comma, try removing that.

    #another questions:
    1-



    2-Add this to your css:

    textarea {
    resize: none;
    }
    # January 26, 2012 at 6:24 am

    for your 1st answer , another error appeared ..
    this is my comment.php file that work on it :


    < ?php
    /**
    * @package WordPress
    * @
    */
    ?>


    < ?php if ( post_password_required() ) : ?>


    < ?php
    /* Stop the rest of comments.php from being processed,
    * but don't kill the script entirely -- we still have
    * to fully load the template.
    */
    return;
    endif;
    ?>

    < ?php
    // You can start editing here -- including this comment!
    ?>
    < ?php if ( have_comments() ) : ?>

    التعليقات على هذه التدوينة : < ?php comments_number( '0', '1', '%' ); ?>





      < ?php wp_list_comments( array( 'callback' => 'athoob_comment' ) ); ?>



    < ?php else : // this is displayed if there are no comments so far ?>

    < ?php if ( comments_open() ) : // If comments are open, but there are no comments ?>

    < ?php else : // or, if we don't have comments:

    /* If there are no comments and comments are closed,
    * let's leave a little note, shall we?
    * But only on posts! We don't want the note on pages.
    */
    if ( ! comments_open() && ! is_page() ) :
    ?>

    < ?php endif; // end ! comments_open() && ! is_page() ?>
    < ?php endif; ?>

    < ?php endif; ?>


    < ?php $comment_args = array(
    'fields' => apply_filters( 'comment_form_default_fields', array(
    'author' => '

    ' . ( $req ? '*' : '' ) .
    '

    ',
    'email' => '',
    'url' => '

    ' .
    '

    '
    ),
    'logged_in_as' => '

    ' . sprintf( __( 'أنت مسجل باسم %2$s. خروج' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '

    ',
    'comment_notes_after' => '',
    'comment_field' => '

    '

    );
    ?>
    < ?php comment_form($comment_args);?>
    ?>
    # January 26, 2012 at 11:52 am

    This is line 62:

    'logged_in_as'             => '

    ' . sprintf( __( 'أنت مسجل باسم %2$s. خروج' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '

    ',

    I wonder if it’s not liking the language? Try replacing the above with this:

    'logged_in_as'             => '

    ' . sprintf( __( 'Logged in as %2$s. Log out?' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '

    ',

    If that works, then you know it’s something that you’ve changed that isn’t working.

    # January 26, 2012 at 1:42 pm

    still error in line 62

    # January 26, 2012 at 1:49 pm

    You have 33 open brackets but only 32 closed brackets. Something isn’t being closed.

    # January 27, 2012 at 4:32 am

    i cant find it ….

    # January 27, 2012 at 12:18 pm

    Here:

    < ?php $comment_args = array(
    'fields' => apply_filters( 'comment_form_default_fields', array(
    'author' => '

    ' . ( $req ? '*' : '' ) .
    '

    ',
    'email' => '',
    'url' => '

    ' .
    '

    '
    ),
    'logged_in_as' => '

    ' . sprintf( __( 'أنت مسجل باسم %2$s. خروج' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '

    ',
    'comment_notes_after' => '',
    'comment_field' => '

    '

    ); // THIS IS CLOSING YOUR APPLY_FILTERS, NOT THE ARRAY
    __
    # September 3, 2012 at 4:09 pm

    in addition, you have some indices with associative keys, and others with only values. is that intentional? I would also recommend formatting/indenting your code to make it easier to find mistakes like this.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Projects

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by MediaTemple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.

*May or may not contain any actual "CSS" or "Tricks".